mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-30 21:21:16 +00:00
e45327df5d
OAuth2 allows the user to only consent to a subset of the scopes requested. Previously, the Generic Oauth2 implementation assumes that the `username`, `email` and `displayName` attributes are supplied, and may crash if they are not defined. This commit allows for `email` and `displayName` to not be defined, either through the user refusing consent or the OAuth2 configuration not asking for them in the first place (by not setting `userProfile*Attr`). If `email` is not provided, the `emails` property is simply left empty. If `displayName` is not provided, it is left undefined, and CodiMD uses the `username` whenever the `displayName` is expected. This does not deal with the case where `username` is not provided. Since usernames are not unique in CodiMD, it is possible to deal with this by setting a dummy username. This can be added in a future commit if desired. Fixes #406 Signed-off-by: Dexter Chua <dalcde@yahoo.com.hk> |
||
---|---|---|
.. | ||
lib | ||
test |