Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/auth cookie donain #61

Merged
merged 12 commits into from
Jan 28, 2024
6 changes: 3 additions & 3 deletions backend/src/endPoints/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class LuciaAuthentication implements AuthenticationController {
sessionCookie.attributes.sameSite = "none";
sessionCookie.attributes.secure = true;

console.log(sessionCookie)
console.log(sessionCookie);

const payload: AuthOutput = {
user,
Expand Down Expand Up @@ -111,15 +111,15 @@ class LuciaAuthentication implements AuthenticationController {
const sessionCookie = auth.createSessionCookie(session);

const a = env.WEB_PAGE_DOMAIN.split("//")[1];
const b = a.split(":")[0];
const b = "stage.rememberry.app";
console.log(b);
sessionCookie.attributes.domain = b;

sessionCookie.attributes.httpOnly = true;
sessionCookie.attributes.sameSite = "none";
sessionCookie.attributes.secure = true;

console.log(sessionCookie)
console.log(sessionCookie);

const user = await auth.getUser(key.userId);

Expand Down
1 change: 1 addition & 0 deletions backend/src/endPoints/auth/auth.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const authRouter = router({
throw errorCheck;
}
opts.ctx.res.setHeader("Set-Cookie", res.sessionCookie);
console.log(opts.ctx.res);
return res.user;
}),
logout: publicProcedure.output(UserRouterOutput).mutation(async (opts) => {
Expand Down
14 changes: 12 additions & 2 deletions deployments/staging-frontend-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@ spec:
configMapKeyRef:
name: staging-frontend-cfg
key: NEXT_PUBLIC_BACKEND_PORT
- name: PORT
- name: NEXT_PUBLIC_APP_ENV
valueFrom:
configMapKeyRef:
name: staging-frontend-cfg
key: NEXT_PORT
key: NEXT_PUBLIC_APP_ENV
- name: APP_ENV
valueFrom:
configMapKeyRef:
name: staging-frontend-cfg
key: APP_ENV
- name: NODE_ENV
valueFrom:
configMapKeyRef:
name: staging-frontend-cfg
key: NODE_ENV
Loading