Skip to content

Commit

Permalink
Merge pull request #16 from Marvell-Consulting/fix/cookie-domain
Browse files Browse the repository at this point in the history
let cookie work across subdomains
  • Loading branch information
wheelsandcogs authored Sep 18, 2024
2 parents 36718e9 + 589e9dd commit 1f04211
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controllers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { User } from '../entities/user';
import { sanitiseUser } from '../utils/sanitise-user';

const returnURL = `${process.env.FRONTEND_URL}/auth/callback`;
const domain = new URL(process.env.BACKEND_URL || '').hostname;
const domain = new URL(process.env.BACKEND_URL || '').hostname.replace('statswales-develop-backend.', '');
logger.debug(`cookie domain: ${domain}`);

const DEFAULT_TOKEN_EXPIRY = '1d';

export const loginGoogle: RequestHandler = (req, res, next) => {
Expand Down

0 comments on commit 1f04211

Please sign in to comment.