Skip to content
Snippets Groups Projects
Commit 34cc4d6a authored by Kyle Doherty's avatar Kyle Doherty
Browse files

handle case where no email is configured

parent 89fc5db5
Branches
Tags
No related merge requests found
......@@ -76,6 +76,8 @@ AuthControllers.controller('ForgotPassword', ['$scope', '$cookies', '$location',
$scope.sentNotification = false;
$scope.emailConfigured = MetabaseSettings.isEmailConfigured()
$scope.sendResetNotification = function(email) {
Session.forgot_password({
'email': email
......
......@@ -4,31 +4,39 @@
<div class="Grid-cell flex layout-centered text-brand">
<mb-logo-icon class="Logo my4 sm-my0" width="66px" height="85px"></mb-logo-icon>
</div>
<div class="Grid-cell" ng-show="!sentNotification">
<form class="ForgotForm bg-white Form-new bordered rounded shadowed" name="form" novalidate>
<h3 class="Login-header Form-offset mb3">Forgot password</h3>
<div class="Grid-cell" ng-show="!emailConfigured">
<div class="text-centered bordered rounded shadowed p4">
<h3 class="my4">Please contact an administrator to have them reset your password</h3>
<a class="link block mb4" href="/auth/login">Back to login</a>
</div>
</div>
<div class="Grid-cell" ng-show="emailConfigured">
<div ng-show="!sentNotification">
<form class="ForgotForm bg-white Form-new bordered rounded shadowed" name="form" novalidate>
<h3 class="Login-header Form-offset mb3">Forgot password</h3>
<mb-form-message form="form"></mb-form-message>
<mb-form-message form="form"></mb-form-message>
<div class="Form-field" mb-form-field="email">
<mb-form-label display-name="Email address" field-name="email"></mb-form-label>
<input class="Form-input Form-offset full" name="email" placeholder="The email you use for your Metabase account" type="text" ng-model="email" required autofocus>
<span class="Form-charm"></span>
</div>
<div class="Form-field" mb-form-field="email">
<mb-form-label display-name="Email address" field-name="email"></mb-form-label>
<input class="Form-input Form-offset full" name="email" placeholder="The email you use for your Metabase account" type="text" ng-model="email" required autofocus>
<span class="Form-charm"></span>
</div>
<div class="Form-actions">
<button class="Button" ng-class="{'Button--primary': form.$valid}" ng-click="sendResetNotification(email)" ng-disabled="!form.$valid">
Send password reset email
</button>
</div>
</form>
</div>
<div class="Grid-cell" ng-show="sentNotification">
<div class="SuccessGroup bg-white bordered rounded shadowed">
<div class="SuccessMark">
<mb-icon name="check"></mb-icon>
<div class="Form-actions">
<button class="Button" ng-class="{'Button--primary': form.$valid}" ng-click="sendResetNotification(email)" ng-disabled="!form.$valid">
Send password reset email
</button>
</div>
</form>
</div>
<div ng-show="sentNotification">
<div class="SuccessGroup bg-white bordered rounded shadowed">
<div class="SuccessMark">
<mb-icon name="check"></mb-icon>
</div>
<p class="SuccessText">Check your email for instructions on how to reset your password.</p>
</div>
<p class="SuccessText">Check your email for instructions on how to reset your password.</p>
</div>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment