mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
tokens: Add token creation
Fix token deletion Update plantuml docs Add token validUntil and lastUsed fields Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
fd70b2d121
commit
599fe57ec6
9 changed files with 113 additions and 35 deletions
|
@ -7,8 +7,10 @@ export class AuthService {
|
|||
constructor(private usersService: UsersService) {}
|
||||
|
||||
async validateToken(token: string): Promise<User> {
|
||||
const user = await this.usersService.getUserByAuthToken(token);
|
||||
const parts = token.split('.');
|
||||
const user = await this.usersService.getUserByAuthToken(parts[0], parts[1]);
|
||||
if (user) {
|
||||
await this.usersService.setLastUsedToken(parts[0])
|
||||
return user;
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue