mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
fix: Return scopes on owner setup endpoint (no-changelog) (#7860)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
parent
c08c5cc37b
commit
e282ea242d
|
@ -101,7 +101,7 @@ export class OwnerController {
|
||||||
|
|
||||||
void this.internalHooks.onInstanceOwnerSetup({ user_id: userId });
|
void this.internalHooks.onInstanceOwnerSetup({ user_id: userId });
|
||||||
|
|
||||||
return this.userService.toPublic(owner, { posthog: this.postHog });
|
return this.userService.toPublic(owner, { posthog: this.postHog, withScopes: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('/dismiss-banner')
|
@Post('/dismiss-banner')
|
||||||
|
|
|
@ -60,6 +60,7 @@ describe('POST /owner/setup', () => {
|
||||||
password,
|
password,
|
||||||
isPending,
|
isPending,
|
||||||
apiKey,
|
apiKey,
|
||||||
|
globalScopes,
|
||||||
} = response.body.data;
|
} = response.body.data;
|
||||||
|
|
||||||
expect(validator.isUUID(id)).toBe(true);
|
expect(validator.isUUID(id)).toBe(true);
|
||||||
|
@ -72,6 +73,7 @@ describe('POST /owner/setup', () => {
|
||||||
expect(globalRole.name).toBe('owner');
|
expect(globalRole.name).toBe('owner');
|
||||||
expect(globalRole.scope).toBe('global');
|
expect(globalRole.scope).toBe('global');
|
||||||
expect(apiKey).toBeUndefined();
|
expect(apiKey).toBeUndefined();
|
||||||
|
expect(globalScopes).not.toHaveLength(0);
|
||||||
|
|
||||||
const storedOwner = await Container.get(UserRepository).findOneByOrFail({ id });
|
const storedOwner = await Container.get(UserRepository).findOneByOrFail({ id });
|
||||||
expect(storedOwner.password).not.toBe(newOwnerData.password);
|
expect(storedOwner.password).not.toBe(newOwnerData.password);
|
||||||
|
|
Loading…
Reference in a new issue