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