Skip to content

Commit ba639d1

Browse files
committed
fix: add secure for samesite
1 parent 56a9d12 commit ba639d1

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

src/auth/auth.controller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import { ErrorDto } from '../common/dto/error.dto';
4343
whitelist: true,
4444
errorHttpStatusCode: 422,
4545
exceptionFactory: (errors) => {
46-
console.log(errors);
4746
throw new UnprocessableEntityException(
4847
Object.values(errors[0].constraints)[0],
4948
);

src/auth/local.strategy.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ export class LocalStrategy extends PassportStrategy(Strategy) {
1313
}
1414

1515
async validate(email: string, password: string): Promise<any> {
16-
console.log(1);
1716
const user = await this.authService.validateUser(email, password);
18-
console.log(user);
1917
if (!user) {
2018
throw new ForbiddenException('Неверные учетные данные');
2119
}

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ async function bootstrap() {
1313
const configService = app.get<ConfigService>(ConfigService);
1414

1515
app.setGlobalPrefix('api');
16-
1716
app.enableCors({
1817
origin: configService.get('corsOrigin'),
1918
credentials: true,
@@ -28,6 +27,7 @@ async function bootstrap() {
2827
unset: 'destroy',
2928
cookie: {
3029
sameSite: 'none',
30+
secure: configService.get('publicUrl').startsWith('https'),
3131
},
3232
store: new (SQLiteStoreFactory(session))({
3333
db: 'sessions.sqlite3',

0 commit comments

Comments
 (0)