mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 08:04:45 -04:00
fix(oauth2): verify user id exists
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
fb6218ed82
commit
a8d5cb754c
2 changed files with 6 additions and 0 deletions
|
@ -62,6 +62,11 @@ function parseProfile (data) {
|
|||
const displayName = extractProfileAttribute(data, config.oauth2.userProfileDisplayNameAttr)
|
||||
const email = extractProfileAttribute(data, config.oauth2.userProfileEmailAttr)
|
||||
|
||||
if (id === undefined && username === undefined) {
|
||||
logger.error('oauth2 auth failed: id and username are undefined')
|
||||
throw new Error('User ID or Username required')
|
||||
}
|
||||
|
||||
return {
|
||||
id: id || username,
|
||||
username,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue