include sub in standard claims

This commit is contained in:
Evert Prants 2022-12-02 22:55:40 +02:00
parent e394880539
commit 4d6267d40a
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 8 additions and 1 deletions

View File

@ -62,6 +62,7 @@ export class ApiController {
display_name: user.display_name,
// Standard claims
sub: user.uuid,
name: user.display_name,
preferred_username: user.username,
nickname: user.display_name,
@ -72,7 +73,12 @@ export class ApiController {
userData.email_verified = true;
}
if ((scope.includes('image') || scopelessAccess) && user.picture) {
if (
(scope.includes('image') ||
scope.includes('picture') ||
scopelessAccess) &&
user.picture
) {
userData.image = `${this._config.get('app.base_url')}/uploads/${
user.picture.file
}`;

View File

@ -87,6 +87,7 @@ export class OAuth2Controller {
display_name: user.display_name,
// Standard claims
sub: user.uuid,
name: user.display_name,
preferred_username: user.username,
nickname: user.display_name,