fix(auth): sign up page not found when entering with url directly (#4002)

This commit is contained in:
YANG QIA 2024-04-10 11:08:08 +08:00 committed by GitHub
parent 0bb5d5f5ee
commit f12952de1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,11 +3,16 @@ import React from 'react';
import { Outlet } from 'react-router-dom';
import { useSystemSettings, PoweredBy, useRequest, useAPIClient } from '@nocobase/client';
import { AuthenticatorsContext } from '../authenticator';
import { Spin } from 'antd';
export function AuthLayout(props: any) {
const { data } = useSystemSettings();
const api = useAPIClient();
const { data: authenticators = [], error } = useRequest(() =>
const {
data: authenticators = [],
error,
loading,
} = useRequest(() =>
api
.resource('authenticators')
.publicList()
@ -16,6 +21,10 @@ export function AuthLayout(props: any) {
}),
);
if (loading) {
return <Spin />;
}
if (error) {
throw error;
}