mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore(server): remove token when logged out (#1560)
* chore(mobile): invoke logout() on mobile app * feat: add mechanism to delete token from logging out endpoint * fix: set state after login sequence success * fix: not removing token when logging out from OAuth * fix: prettier * refactor: using accessTokenId to delete * chore: pr comments * fix: test * fix: test threshold
This commit is contained in:
parent
16183791f3
commit
7dbddba757
9 changed files with 37 additions and 21 deletions
|
|
@ -76,7 +76,11 @@ export class AuthService {
|
|||
return this.authCore.createLoginResponse(user, AuthType.PASSWORD, isSecure);
|
||||
}
|
||||
|
||||
public async logout(authType: AuthType): Promise<LogoutResponseDto> {
|
||||
public async logout(authUser: AuthUserDto, authType: AuthType): Promise<LogoutResponseDto> {
|
||||
if (authUser.accessTokenId) {
|
||||
await this.userTokenCore.deleteToken(authUser.accessTokenId);
|
||||
}
|
||||
|
||||
if (authType === AuthType.OAUTH) {
|
||||
const url = await this.oauthCore.getLogoutEndpoint();
|
||||
if (url) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue