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. 20
      public/app/core/components/Login/LoginServiceButtons.tsx
  2. 2
      public/app/partials/reset_password.html

@ -1,7 +1,10 @@
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 = () => {
const oauthEnabled = !!config.oauth;
return {
saml: { saml: {
enabled: config.samlEnabled, enabled: config.samlEnabled,
name: 'SAML', name: 'SAML',
@ -9,30 +12,31 @@ const loginServices: () => LoginServices = () => ({
icon: 'key', icon: 'key',
}, },
google: { google: {
enabled: config.oauth.google, enabled: oauthEnabled && config.oauth.google,
name: 'Google', name: 'Google',
}, },
github: { github: {
enabled: config.oauth.github, enabled: oauthEnabled && config.oauth.github,
name: 'GitHub', name: 'GitHub',
}, },
gitlab: { gitlab: {
enabled: config.oauth.gitlab, enabled: oauthEnabled && config.oauth.gitlab,
name: 'GitLab', name: 'GitLab',
}, },
grafanacom: { grafanacom: {
enabled: config.oauth.grafana_com, enabled: oauthEnabled && config.oauth.grafana_com,
name: 'Grafana.com', name: 'Grafana.com',
hrefName: 'grafana_com', hrefName: 'grafana_com',
icon: 'grafana_com', icon: 'grafana_com',
}, },
oauth: { oauth: {
enabled: config.oauth.generic_oauth, enabled: oauthEnabled && config.oauth.generic_oauth,
name: config.oauth.generic_oauth ? config.oauth.generic_oauth.name : 'OAuth', name: oauthEnabled && config.oauth.generic_oauth ? config.oauth.generic_oauth.name : 'OAuth',
icon: 'sign-in', icon: 'sign-in',
hrefName: 'generic_oauth', 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