Skip to content

Commit

Permalink
fix(server): Increase authentication cookie max-age (immich-app#1971)
Browse files Browse the repository at this point in the history
This got missed in immich-app#1381.
  • Loading branch information
bo0tzz authored Mar 8, 2023
1 parent 9ac087c commit 838ea56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/libs/domain/src/auth/auth.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class AuthCore {
}

public getCookies(loginResponse: LoginResponseDto, authType: AuthType, isSecure: boolean) {
const maxAge = 7 * 24 * 3600; // 7 days
const maxAge = 400 * 24 * 3600; // 400 days

let authTypeCookie = '';
let accessTokenCookie = '';
Expand Down
12 changes: 6 additions & 6 deletions server/libs/domain/test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ export const loginResponseStub = {
shouldChangePassword: false,
},
cookie: [
'immich_access_token=cmFuZG9tLWJ5dGVz; HttpOnly; Secure; Path=/; Max-Age=604800; SameSite=Lax;',
'immich_auth_type=oauth; HttpOnly; Secure; Path=/; Max-Age=604800; SameSite=Lax;',
'immich_access_token=cmFuZG9tLWJ5dGVz; HttpOnly; Secure; Path=/; Max-Age=34560000; SameSite=Lax;',
'immich_auth_type=oauth; HttpOnly; Secure; Path=/; Max-Age=34560000; SameSite=Lax;',
],
},
user1password: {
Expand All @@ -354,8 +354,8 @@ export const loginResponseStub = {
shouldChangePassword: false,
},
cookie: [
'immich_access_token=cmFuZG9tLWJ5dGVz; HttpOnly; Secure; Path=/; Max-Age=604800; SameSite=Lax;',
'immich_auth_type=password; HttpOnly; Secure; Path=/; Max-Age=604800; SameSite=Lax;',
'immich_access_token=cmFuZG9tLWJ5dGVz; HttpOnly; Secure; Path=/; Max-Age=34560000; SameSite=Lax;',
'immich_auth_type=password; HttpOnly; Secure; Path=/; Max-Age=34560000; SameSite=Lax;',
],
},
user1insecure: {
Expand All @@ -370,8 +370,8 @@ export const loginResponseStub = {
shouldChangePassword: false,
},
cookie: [
'immich_access_token=cmFuZG9tLWJ5dGVz; HttpOnly; Path=/; Max-Age=604800; SameSite=Lax;',
'immich_auth_type=password; HttpOnly; Path=/; Max-Age=604800; SameSite=Lax;',
'immich_access_token=cmFuZG9tLWJ5dGVz; HttpOnly; Path=/; Max-Age=34560000; SameSite=Lax;',
'immich_auth_type=password; HttpOnly; Path=/; Max-Age=34560000; SameSite=Lax;',
],
},
};
Expand Down

0 comments on commit 838ea56

Please sign in to comment.