Navigation: Fix navigation when new password is chosen (#20747)

pull/20776/head
Peter Holmberg 6 years ago committed by Torkel Ödegaard
parent 71792d698b
commit b3816a2727
  1. 68
      public/app/core/components/Login/LoginServiceButtons.tsx
  2. 2
      public/app/partials/reset_password.html

@ -1,38 +1,42 @@
import React from 'react'; import React from 'react';
import config from 'app/core/config'; import config from 'app/core/config';
const loginServices: () => LoginServices = () => ({ const loginServices: () => LoginServices = () => {
saml: { const oauthEnabled = !!config.oauth;
enabled: config.samlEnabled,
name: 'SAML', return {
className: 'github', saml: {
icon: 'key', enabled: config.samlEnabled,
}, name: 'SAML',
google: { className: 'github',
enabled: config.oauth.google, icon: 'key',
name: 'Google', },
}, google: {
github: { enabled: oauthEnabled && config.oauth.google,
enabled: config.oauth.github, name: 'Google',
name: 'GitHub', },
}, github: {
gitlab: { enabled: oauthEnabled && config.oauth.github,
enabled: config.oauth.gitlab, name: 'GitHub',
name: 'GitLab', },
}, gitlab: {
grafanacom: { enabled: oauthEnabled && config.oauth.gitlab,
enabled: config.oauth.grafana_com, name: 'GitLab',
name: 'Grafana.com', },
hrefName: 'grafana_com', grafanacom: {
icon: 'grafana_com', enabled: oauthEnabled && config.oauth.grafana_com,
}, name: 'Grafana.com',
oauth: { hrefName: 'grafana_com',
enabled: config.oauth.generic_oauth, icon: 'grafana_com',
name: config.oauth.generic_oauth ? config.oauth.generic_oauth.name : 'OAuth', },
icon: 'sign-in', oauth: {
hrefName: 'generic_oauth', enabled: oauthEnabled && config.oauth.generic_oauth,
}, name: oauthEnabled && config.oauth.generic_oauth ? config.oauth.generic_oauth.name : 'OAuth',
}); icon: 'sign-in',
hrefName: 'generic_oauth',
},
};
};
export interface LoginService { export interface LoginService {
enabled: boolean; enabled: boolean;

@ -10,7 +10,7 @@
<div ng-if="disableLoginForm"> <div ng-if="disableLoginForm">
You cannot reset password when login form is disabled. You cannot reset password when login form is disabled.
</div> </div>
<form name="sendResetForm" class="login-form gf-form-group" ng-show="mode === 'send'" ng-hide="ldapEnabled || authProxyEnabled || disableLoginForm"> <form name="sendResetForm" class="login-form gf-form-group" ng-show="mode === 'send'" ng-hide="ldapEnabled || authProxyEnabled || disableLoginForm || mode === 'reset'">
<div class="gf-form"> <div class="gf-form">
<span class="gf-form-label width-7">User</span> <span class="gf-form-label width-7">User</span>
<input type="text" name="username" class="gf-form-input max-width-14" required ng-model='formModel.userOrEmail' placeholder="email or username"> <input type="text" name="username" class="gf-form-input max-width-14" required ng-model='formModel.userOrEmail' placeholder="email or username">

Loading…
Cancel
Save