mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
console: move back to metadata apis for verifying login
GitOrigin-RevId: 56581f7f05f8c69d8b2d38c3719057b489132437
This commit is contained in:
parent
06a129d5c0
commit
71d5955654
@ -5,6 +5,7 @@ import { ADMIN_SECRET_HEADER_KEY, CLI_CONSOLE_MODE } from '../../constants';
|
||||
import requestAction from '../../utils/requestAction';
|
||||
import { Dispatch } from '../../types';
|
||||
import globals from '../../Globals';
|
||||
import { inconsistentObjectsQuery } from '../../metadata/queryUtils';
|
||||
|
||||
type VerifyLoginOptions = {
|
||||
adminSecret: string;
|
||||
@ -22,14 +23,15 @@ export const verifyLogin = ({
|
||||
dispatch,
|
||||
}: VerifyLoginOptions) => {
|
||||
const options: RequestInit = {
|
||||
method: 'GET',
|
||||
method: 'POST',
|
||||
credentials: globalCookiePolicy,
|
||||
headers: {
|
||||
[ADMIN_SECRET_HEADER_KEY]: adminSecret,
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(inconsistentObjectsQuery),
|
||||
};
|
||||
return dispatch(requestAction(Endpoints.serverConfig, options)).then(
|
||||
return dispatch(requestAction(Endpoints.metadata, options)).then(
|
||||
() => {
|
||||
if (adminSecret) {
|
||||
if (globals.consoleMode !== CLI_CONSOLE_MODE) {
|
||||
|
Loading…
Reference in New Issue
Block a user