feat: Add scopes to /login endpoint (no-changelog) (#7718)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Val
2023-11-16 11:11:55 +00:00
committed by GitHub
parent ebee1a5908
commit d39bb2540f
9 changed files with 158 additions and 15 deletions

View File

@@ -104,7 +104,7 @@ export class AuthController {
authenticationMethod: usedAuthenticationMethod,
});
return this.userService.toPublic(user, { posthog: this.postHog });
return this.userService.toPublic(user, { posthog: this.postHog, withScopes: true });
}
void this.internalHooks.onUserLoginFailed({
user: email,
@@ -129,7 +129,7 @@ export class AuthController {
try {
user = await resolveJwt(cookieContents);
return await this.userService.toPublic(user, { posthog: this.postHog });
return await this.userService.toPublic(user, { posthog: this.postHog, withScopes: true });
} catch (error) {
res.clearCookie(AUTH_COOKIE_NAME);
}
@@ -152,7 +152,7 @@ export class AuthController {
}
await issueCookie(res, user);
return this.userService.toPublic(user, { posthog: this.postHog });
return this.userService.toPublic(user, { posthog: this.postHog, withScopes: true });
}
/**