mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
Allow configuration of SSO Cookie Domain (#16471)
This commit is contained in:
parent
7bdbd665af
commit
7f1bb7e73f
@ -95,13 +95,14 @@ const redirectWithAuth = (ctx) => {
|
|||||||
params: { provider },
|
params: { provider },
|
||||||
} = ctx;
|
} = ctx;
|
||||||
const redirectUrls = utils.getPrefixedRedirectUrls();
|
const redirectUrls = utils.getPrefixedRedirectUrls();
|
||||||
|
const domain = strapi.config.get('server.admin.auth.domain');
|
||||||
const { user } = ctx.state;
|
const { user } = ctx.state;
|
||||||
|
|
||||||
const jwt = getService('token').createJwtToken(user);
|
const jwt = getService('token').createJwtToken(user);
|
||||||
|
|
||||||
const isProduction = strapi.config.get('environment') === 'production';
|
const isProduction = strapi.config.get('environment') === 'production';
|
||||||
|
|
||||||
const cookiesOptions = { httpOnly: false, secure: isProduction, overwrite: true };
|
const cookiesOptions = { httpOnly: false, secure: isProduction, overwrite: true, domain };
|
||||||
|
|
||||||
const sanitizedUser = getService('user').sanitizeUser(user);
|
const sanitizedUser = getService('user').sanitizeUser(user);
|
||||||
strapi.eventHub.emit('admin.auth.success', { user: sanitizedUser, provider });
|
strapi.eventHub.emit('admin.auth.success', { user: sanitizedUser, provider });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user