mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 18:55:19 -04:00
auth: Fix base64url transformation
The problem was that replace only replaces the first occurrence of a string and not all as is needed for this function. tsconfig.json needed lib to be set to esnext or the replaceAll function won't be available… Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
f8757d0e5b
commit
7aeb77b262
2 changed files with 5 additions and 4 deletions
|
@ -70,9 +70,9 @@ export class AuthService {
|
||||||
// base64url is quite easy buildable from base64
|
// base64url is quite easy buildable from base64
|
||||||
return text
|
return text
|
||||||
.toString('base64')
|
.toString('base64')
|
||||||
.replace('+', '-')
|
.replaceAll(/\+/g, '-')
|
||||||
.replace('/', '_')
|
.replaceAll(/\//g, '_')
|
||||||
.replace(/=+$/, '');
|
.replaceAll(/=+$/g, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
async createTokenForUser(
|
async createTokenForUser(
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"incremental": true
|
"incremental": true,
|
||||||
|
"lib": ["esnext"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue