server: invalidate previous tokens when user changed

This commit is contained in:
Jesse Chan
2021-01-26 08:57:38 +08:00
parent 53c0b3f863
commit 402a5b8a69
5 changed files with 43 additions and 6 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ export const credentialsSchema = object({
export type Credentials = zodInfer<typeof credentialsSchema>;
export type UserInDatabase = Required<Credentials> & {_id: string};
export type UserInDatabase = Required<Credentials> & {_id: string; timestamp: number};
export const authTokenSchema = object({
username: string(),