mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 21:23:10 +00:00
Skip signin page if auth config is empty (#33)
* Fixing behaviour for secure and non-secure mode * Adding swagger html to prettier ignore files
This commit is contained in:
parent
f92151eed1
commit
dba033711d
@ -30,5 +30,10 @@ dist/
|
|||||||
.prettierignore
|
.prettierignore
|
||||||
.eslintignore
|
.eslintignore
|
||||||
|
|
||||||
|
# rc, json and html files
|
||||||
|
.prettierrc
|
||||||
|
.lintstagedrc.json
|
||||||
|
swagger.html
|
||||||
|
|
||||||
# macOS
|
# macOS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { AxiosResponse } from 'axios';
|
import { AxiosResponse } from 'axios';
|
||||||
import { CookieStorage } from 'cookie-storage';
|
import { CookieStorage } from 'cookie-storage';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty, isNil } from 'lodash';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { User } from 'Models';
|
import { User } from 'Models';
|
||||||
import { UserManager, WebStorageStateStore } from 'oidc-client';
|
import { UserManager, WebStorageStateStore } from 'oidc-client';
|
||||||
@ -155,7 +155,10 @@ const AuthProvider: FunctionComponent<AuthProviderProps> = ({
|
|||||||
const fetchAuthConfig = (): void => {
|
const fetchAuthConfig = (): void => {
|
||||||
fetchAuthorizerConfig()
|
fetchAuthorizerConfig()
|
||||||
.then((res: AxiosResponse) => {
|
.then((res: AxiosResponse) => {
|
||||||
if (res.data) {
|
const isSecureMode =
|
||||||
|
!isNil(res.data) &&
|
||||||
|
Object.values(res.data).filter((item) => isNil(item)).length === 0;
|
||||||
|
if (isSecureMode) {
|
||||||
const { provider, authority, clientId, callbackUrl } = res.data;
|
const { provider, authority, clientId, callbackUrl } = res.data;
|
||||||
const userConfig = getUserManagerConfig({
|
const userConfig = getUserManagerConfig({
|
||||||
authority,
|
authority,
|
||||||
|
@ -100,7 +100,7 @@ const Signup = () => {
|
|||||||
...details,
|
...details,
|
||||||
teams: selectedTeams as Array<string>,
|
teams: selectedTeams as Array<string>,
|
||||||
profile: {
|
profile: {
|
||||||
images: getImages(appState.newUser.picture),
|
images: getImages(appState.newUser.picture ?? ''),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user