Skip to content

Commit

Permalink
changed domain name in login
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush7801 committed May 18, 2024
1 parent 7f171dc commit e9ae1a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/src/controller/userController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const userSignup = async (req: Request, res: Response, next: NextFunction) => {
// clear previous cookies and send new cookie with jwt token
res.clearCookie(Constants.AUTH_COOKIE_NAME, {
path: '/',
domain: 'localhost',
domain: Constants.DOMAIN_NAME,
signed: true,
httpOnly: true
});
Expand All @@ -52,7 +52,7 @@ const userSignup = async (req: Request, res: Response, next: NextFunction) => {
const token = createToken(payload, '7d');
res.cookie(Constants.AUTH_COOKIE_NAME, token, {
path: '/',
domain: 'localhost',
domain: Constants.DOMAIN_NAME,
signed: true,
expires: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
httpOnly: true
Expand Down Expand Up @@ -94,7 +94,7 @@ const userLogin = async (req: Request, res: Response, next: NextFunction) => {
// clear previous cookies and send new cookie with jwt token
res.clearCookie(Constants.AUTH_COOKIE_NAME, {
path: '/',
domain: 'localhost',
domain: Constants.DOMAIN_NAME,
signed: true,
httpOnly: true
});
Expand All @@ -105,7 +105,7 @@ const userLogin = async (req: Request, res: Response, next: NextFunction) => {
const token = createToken(payload, '7d');
res.cookie(Constants.AUTH_COOKIE_NAME, token, {
path: '/',
domain: 'localhost',
domain: Constants.DOMAIN_NAME,
signed: true,
expires: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
httpOnly: true
Expand Down

0 comments on commit e9ae1a7

Please sign in to comment.