apps/api: add cookie options (httpOnly, secure)
This commit is contained in:
parent
79d8e89874
commit
7b73758d70
@ -3,17 +3,20 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import { AuthService } from './auth.service';
|
||||
import { Credentials } from './types/request';
|
||||
import type { CookieSerializeOptions } from '@fastify/cookie';
|
||||
import { Body, Controller, Get, HttpException, HttpStatus, Post, Req, Res } from '@nestjs/common';
|
||||
import { FastifyReply, FastifyRequest } from 'fastify';
|
||||
import { env } from 'src/config/env';
|
||||
|
||||
@Controller()
|
||||
export class AuthController {
|
||||
cookieOptions: { maxAge: number; path: string };
|
||||
cookieOptions: CookieSerializeOptions;
|
||||
constructor(private readonly authService: AuthService) {
|
||||
this.cookieOptions = {
|
||||
httpOnly: true,
|
||||
maxAge: env.API_TOKEN_TTL,
|
||||
path: '/',
|
||||
secure: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user