mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
feat: Add scopes to /login endpoint (no-changelog) (#7718)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -113,7 +113,10 @@ export class UserService {
|
||||
return user;
|
||||
}
|
||||
|
||||
async toPublic(user: User, options?: { withInviteUrl?: boolean; posthog?: PostHogClient }) {
|
||||
async toPublic(
|
||||
user: User,
|
||||
options?: { withInviteUrl?: boolean; posthog?: PostHogClient; withScopes?: boolean },
|
||||
) {
|
||||
const { password, updatedAt, apiKey, authIdentities, ...rest } = user;
|
||||
|
||||
const ldapIdentity = authIdentities?.find((i) => i.providerType === 'ldap');
|
||||
@@ -124,6 +127,10 @@ export class UserService {
|
||||
hasRecoveryCodesLeft: !!user.mfaRecoveryCodes?.length,
|
||||
};
|
||||
|
||||
if (options?.withScopes) {
|
||||
publicUser.globalScopes = user.globalScopes;
|
||||
}
|
||||
|
||||
if (options?.withInviteUrl && publicUser.isPending) {
|
||||
publicUser = this.addInviteUrl(publicUser, user.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user