mirror of
https://github.com/hasura/graphql-engine.git
synced 2025-01-05 22:34:22 +03:00
console: migrate login actions to typescript (#5499)
This commit is contained in:
parent
8c5da552ac
commit
1b96d800c5
@ -3,17 +3,26 @@ import { UPDATE_DATA_HEADERS } from '../Services/Data/DataActions';
|
|||||||
import { saveAdminSecretState } from '../AppState';
|
import { saveAdminSecretState } from '../AppState';
|
||||||
import { ADMIN_SECRET_HEADER_KEY, CLI_CONSOLE_MODE } from '../../constants';
|
import { ADMIN_SECRET_HEADER_KEY, CLI_CONSOLE_MODE } from '../../constants';
|
||||||
import requestAction from '../../utils/requestAction';
|
import requestAction from '../../utils/requestAction';
|
||||||
|
import { Dispatch } from '../../types';
|
||||||
import globals from '../../Globals';
|
import globals from '../../Globals';
|
||||||
|
|
||||||
|
type VerifyLoginOptions = {
|
||||||
|
adminSecret: string;
|
||||||
|
shouldPersist: boolean;
|
||||||
|
successCallback: () => void;
|
||||||
|
errorCallback: (err: Error) => void;
|
||||||
|
dispatch: Dispatch;
|
||||||
|
};
|
||||||
|
|
||||||
export const verifyLogin = ({
|
export const verifyLogin = ({
|
||||||
adminSecret,
|
adminSecret,
|
||||||
shouldPersist,
|
shouldPersist,
|
||||||
successCallback,
|
successCallback,
|
||||||
errorCallback,
|
errorCallback,
|
||||||
dispatch,
|
dispatch,
|
||||||
}) => {
|
}: VerifyLoginOptions) => {
|
||||||
const url = Endpoints.getSchema;
|
const url = Endpoints.getSchema;
|
||||||
const requestOptions = {
|
const requestOptions: RequestInit = {
|
||||||
credentials: globalCookiePolicy,
|
credentials: globalCookiePolicy,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
Loading…
Reference in New Issue
Block a user