Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on first login after password change #4550

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@
</mat-error>
}
</mat-form-field>

<div class="logout-hint" translate>
You will be logged out when you change your password. You must then log in with the new password.
</div>
</form>
1 change: 1 addition & 0 deletions client/src/app/site/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class AuthService {
try {
const response = await callback();
if (response?.success) {
this.lifecycleService.shutdown();
this.authTokenService.setRawAccessToken(null);
this._logoutEvent.emit();
this.sharedWorker.sendMessage(`auth`, { action: `update` });
Expand Down
9 changes: 7 additions & 2 deletions client/src/app/site/services/user-controller.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ export class UserControllerService extends BaseController<ViewUser, User> {
return this.repo.setPassword(user, password, setAsDefault);
}

public setPasswordSelf(user: Identifiable, oldPassword: string, newPassword: string): Promise<void> {
return this.repo.setPasswordSelf(user, oldPassword, newPassword);
public async setPasswordSelf(user: Identifiable, oldPassword: string, newPassword: string): Promise<any> {
const result = await this.repo.setPasswordSelf(user, oldPassword, newPassword);
if (result === null) {
return { success: true };
}

return result;
}

public resetPasswordToDefault(...users: Identifiable[]): Promise<void> {
Expand Down
Loading