mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 15:35:35 +00:00
feat: add user token management
This commit is contained in:
8
app/user/validators/token/create_api_token.ts
Normal file
8
app/user/validators/token/create_api_token.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import vine from '@vinejs/vine';
|
||||
|
||||
export const createApiTokenValidator = vine.compile(
|
||||
vine.object({
|
||||
name: vine.string().trim().minLength(1).maxLength(255),
|
||||
expiresAt: vine.date().optional(),
|
||||
})
|
||||
);
|
||||
9
app/user/validators/token/delete_api_token.ts
Normal file
9
app/user/validators/token/delete_api_token.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import vine from '@vinejs/vine';
|
||||
|
||||
export const deleteApiTokenValidator = vine.compile(
|
||||
vine.object({
|
||||
params: vine.object({
|
||||
tokenId: vine.number().positive(),
|
||||
}),
|
||||
})
|
||||
);
|
||||
Reference in New Issue
Block a user