mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-31 23:28:34 -04:00
auth: Add maximum token lifetime of 2 years.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
6686fa58c5
commit
ad0ab648bc
5 changed files with 24 additions and 27 deletions
|
@ -45,14 +45,17 @@ export class AuthToken {
|
|||
|
||||
public static create(
|
||||
user: User,
|
||||
identifier: string,
|
||||
label: string,
|
||||
keyId: string,
|
||||
accessToken: string,
|
||||
validUntil: Date,
|
||||
): Pick<AuthToken, 'user' | 'accessToken'> {
|
||||
): Pick<
|
||||
AuthToken,
|
||||
'user' | 'label' | 'keyId' | 'accessTokenHash' | 'createdAt' | 'validUntil'
|
||||
> {
|
||||
const newToken = new AuthToken();
|
||||
newToken.user = user;
|
||||
newToken.label = identifier;
|
||||
newToken.label = label;
|
||||
newToken.keyId = keyId;
|
||||
newToken.accessTokenHash = accessToken;
|
||||
newToken.createdAt = new Date();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue