Now anonymous users can confirm the change of email even if they are not authenticated, some users update the email from a desktop browser but check the email from mobile

stable
Alejandro Alonso 2015-06-12 08:50:49 +02:00 committed by David Barragán Merino
parent d29fa9efe5
commit c231bb7575
1 changed files with 8 additions and 5 deletions

View File

@ -474,9 +474,12 @@ ChangeEmailDirective = ($repo, $model, $auth, $confirm, $location, $params, $nav
form = $el.find("form").checksley()
onSuccessSubmit = (response) ->
if $auth.isAuthenticated()
$repo.queryOne("users", $auth.getUser().id).then (data) =>
$auth.setUser(data)
$location.path($navUrls.resolve("home"))
else
$location.path($navUrls.resolve("login"))
text = $translate.instant("CHANGE_EMAIL_FORM.SUCCESS")
$confirm.success(text)