mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-22 21:12:04 +00:00
auth: Fix undefined secret error
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
aa10e10412
commit
08ba52293c
1 changed files with 3 additions and 0 deletions
|
@ -36,6 +36,9 @@ export class AuthService {
|
|||
|
||||
async validateToken(token: string): Promise<User> {
|
||||
const [keyId, secret] = token.split('.');
|
||||
if (!secret) {
|
||||
throw new TokenNotValidError('Invalid AuthToken format');
|
||||
}
|
||||
if (secret.length > 72) {
|
||||
// Only the first 72 characters of the tokens are considered by bcrypt
|
||||
// This should prevent strange corner cases
|
||||
|
|
Loading…
Reference in a new issue