mirror of
https://github.com/kyantech/Palmr.git
synced 2025-11-03 13:33:20 +00:00
feat: Add SECURE_SITE configuration and reverse proxy documentation
- Introduced the SECURE_SITE environment variable to control cookie security settings based on deployment context. - Updated Dockerfile to log SECURE_SITE status during application startup. - Enhanced documentation with a new guide on reverse proxy configuration, detailing the use of SECURE_SITE for secure cookie handling. - Adjusted authentication and email services to utilize SECURE_SITE for secure connections. - Updated frontend components to set cookie security based on the current protocol.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { LoginSchema, RequestPasswordResetSchema, createResetPasswordSchema } from "./dto";
|
||||
import { AuthService } from "./service";
|
||||
import { env } from "env";
|
||||
import { FastifyReply, FastifyRequest } from "fastify";
|
||||
|
||||
export class AuthController {
|
||||
@@ -17,8 +18,8 @@ export class AuthController {
|
||||
reply.setCookie("token", token, {
|
||||
httpOnly: true,
|
||||
path: "/",
|
||||
secure: false,
|
||||
sameSite: "strict",
|
||||
secure: env.SECURE_SITE === "true" ? true : false,
|
||||
sameSite: env.SECURE_SITE === "true" ? "lax" : "strict",
|
||||
});
|
||||
|
||||
return reply.send({ user });
|
||||
|
||||
Reference in New Issue
Block a user