Allow configuration of SSO Cookie Domain

This commit is contained in:
derrickmehaffy 2023-04-21 09:31:21 -07:00
parent 6000668673
commit 156a6d9ece

View File

@ -95,13 +95,14 @@ const redirectWithAuth = (ctx) => {
params: { provider },
} = ctx;
const redirectUrls = utils.getPrefixedRedirectUrls();
const domain = strapi.config.get('server.admin.auth.domain');
const { user } = ctx.state;
const jwt = getService('token').createJwtToken(user);
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);
strapi.eventHub.emit('admin.auth.success', { user: sanitizedUser, provider });