tests: organization and invitation params

Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
This commit is contained in:
Jack Palmer
2026-02-05 14:01:04 +00:00
parent 867c905da5
commit 3458f3a731
2 changed files with 9 additions and 3 deletions
@@ -54,7 +54,9 @@ describe('authModuleAuth0Provider', () => {
const agent = request.agent(server);
const res = await agent.get('/api/auth/auth0/start?env=development');
const res = await agent.get(
'/api/auth/auth0/start?env=development&organization=foo-organization&invitation=foo-invitation',
);
expect(res.status).toEqual(302);
@@ -78,6 +80,8 @@ describe('authModuleAuth0Provider', () => {
accessType: 'offline',
connection: 'connection',
connection_scope: 'connectionScope',
organization: 'foo-organization',
invitation: 'foo-invitation',
nonce: expect.any(String),
state: expect.any(String),
});
@@ -49,10 +49,12 @@ export class Auth0Strategy extends Auth0InternalStrategy {
}
authenticate(req: express.Request, options: Record<string, any>): void {
const { organization, invitation } = req.query;
super.authenticate(req, {
...options,
organization: req.query.organization,
invitation: req.query.invitation,
...(organization ? { organization } : {}),
...(invitation ? { invitation } : {}),
});
}