Skip to content

Commit

Permalink
Merge pull request #5598 from camptocamp/GSGMF-1241_2fa-form
Browse files Browse the repository at this point in the history
Fix double factor authentication form when changing password
  • Loading branch information
llienher authored Mar 9, 2020
2 parents 0b76d12 + adcaedd commit 7438756
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contribs/gmf/src/authentication/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class AuthenticationService extends olEventsEventTarget {
*/
handleLogin_(checkingLoginStatus, resp) {
if (resp.data.is_password_changed === false && this.forcePasswordChange) {
const event = new ngeoCustomEvent('mustChangePassword', {username: resp.data.username});
const event = new ngeoCustomEvent('mustChangePassword', {user: resp.data});
this.dispatchEvent(event);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/authentication/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
ng-attr-placeholder="{{'Confirm new password' | translate}}"/>
</div>
<div ng-if="$ctrl.gmfUser.otp_uri" class="form-group">
<label translate>Two factor authentication barcode:</label>
<label translate>Two factor authentication QR code:</label>
<div><img class="" ng-src="{{$ctrl.otpImage}}"></div>
</div>
<div ng-if="$ctrl.gmfUser.two_factor_totp_secret" class="form-group">
Expand Down
5 changes: 3 additions & 2 deletions contribs/gmf/src/authentication/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,9 @@ class AuthenticationController {
this.userMustChangeItsPassword = false;


listen(gmfAuthenticationService, 'mustChangePassword', (event) => {
const username = /** @type {CustomEvent} */ (event).detail.username;
listen(gmfAuthenticationService, 'mustChangePassword', event => {
const username = /** @type {CustomEvent} */ (event).detail.user.username;
this.gmfUser = /** @type {CustomEvent} */ (event).detail.user;
this.changingPasswordUsername = username;
this.changingPassword = true;
this.userMustChangeItsPassword = true;
Expand Down

0 comments on commit 7438756

Please sign in to comment.