Commit b3816a27 by Peter Holmberg Committed by Torkel Ödegaard

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

parent 71792d69
import React from 'react';
import config from 'app/core/config';
const loginServices: () => LoginServices = () => ({
saml: {
enabled: config.samlEnabled,
name: 'SAML',
className: 'github',
icon: 'key',
},
google: {
enabled: config.oauth.google,
name: 'Google',
},
github: {
enabled: config.oauth.github,
name: 'GitHub',
},
gitlab: {
enabled: config.oauth.gitlab,
name: 'GitLab',
},
grafanacom: {
enabled: config.oauth.grafana_com,
name: 'Grafana.com',
hrefName: 'grafana_com',
icon: 'grafana_com',
},
oauth: {
enabled: config.oauth.generic_oauth,
name: config.oauth.generic_oauth ? config.oauth.generic_oauth.name : 'OAuth',
icon: 'sign-in',
hrefName: 'generic_oauth',
},
});
const loginServices: () => LoginServices = () => {
const oauthEnabled = !!config.oauth;
return {
saml: {
enabled: config.samlEnabled,
name: 'SAML',
className: 'github',
icon: 'key',
},
google: {
enabled: oauthEnabled && config.oauth.google,
name: 'Google',
},
github: {
enabled: oauthEnabled && config.oauth.github,
name: 'GitHub',
},
gitlab: {
enabled: oauthEnabled && config.oauth.gitlab,
name: 'GitLab',
},
grafanacom: {
enabled: oauthEnabled && config.oauth.grafana_com,
name: 'Grafana.com',
hrefName: 'grafana_com',
icon: 'grafana_com',
},
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 {
enabled: boolean;
......
......@@ -10,7 +10,7 @@
<div ng-if="disableLoginForm">
You cannot reset password when login form is disabled.
</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">
<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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment