mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Routes: Redirect signup user and verify email if settings is disabled (#36303)
Fixes #31635
This commit is contained in:
@@ -2,14 +2,8 @@ import React, { FC } from 'react';
|
||||
|
||||
import { LoginLayout, InnerBox } from '../Login/LoginLayout';
|
||||
import { VerifyEmail } from './VerifyEmail';
|
||||
import { getConfig } from 'app/core/config';
|
||||
|
||||
export const VerifyEmailPage: FC = () => {
|
||||
if (!getConfig().verifyEmailEnabled) {
|
||||
window.location.href = getConfig().appSubUrl + '/signup';
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
<LoginLayout>
|
||||
<InnerBox>
|
||||
|
@@ -6,7 +6,6 @@ import config from 'app/core/config';
|
||||
import { DashboardRoutes } from 'app/types';
|
||||
import { SafeDynamicImport } from '../core/components/DynamicImports/SafeDynamicImport';
|
||||
import { RouteDescriptor } from '../core/navigation/types';
|
||||
import { SignupPage } from 'app/core/components/Signup/SignupPage';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import ErrorPage from 'app/core/components/ErrorPage/ErrorPage';
|
||||
|
||||
@@ -280,14 +279,18 @@ export function getAppRoutes(): RouteDescriptor[] {
|
||||
},
|
||||
{
|
||||
path: '/verify',
|
||||
component: SafeDynamicImport(
|
||||
component: !config.verifyEmailEnabled
|
||||
? () => <Redirect to="/signup" />
|
||||
: SafeDynamicImport(
|
||||
() => import(/* webpackChunkName "VerifyEmailPage"*/ 'app/core/components/Signup/VerifyEmailPage')
|
||||
),
|
||||
pageClass: 'login-page sidemenu-hidden',
|
||||
},
|
||||
{
|
||||
path: '/signup',
|
||||
component: SignupPage,
|
||||
component: config.disableUserSignUp
|
||||
? () => <Redirect to="/login" />
|
||||
: SafeDynamicImport(() => import(/* webpackChunkName "SignupPage"*/ 'app/core/components/Signup/SignupPage')),
|
||||
pageClass: 'sidemenu-hidden login-page',
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user