Type generateAuthActions config and remove storage.generateAuthActions
This commit is contained in:
parent
33ed6ad156
commit
b091e39189
|
@ -37,6 +37,7 @@ import {
|
||||||
SignOutRequestFailedAction,
|
SignOutRequestFailedAction,
|
||||||
SetHasVerificationBeenAttemptedAction,
|
SetHasVerificationBeenAttemptedAction,
|
||||||
AppThunk,
|
AppThunk,
|
||||||
|
GenerateAuthActionsConfig,
|
||||||
} from './types'
|
} from './types'
|
||||||
import AsyncLocalStorage from './AsyncLocalStorage'
|
import AsyncLocalStorage from './AsyncLocalStorage'
|
||||||
import {
|
import {
|
||||||
|
@ -121,15 +122,14 @@ export const setHasVerificationBeenAttempted = (
|
||||||
// Async Redux Thunk actions:
|
// Async Redux Thunk actions:
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
const generateAuthActions = (config: { [key: string]: any }) => {
|
const generateAuthActions = (config: GenerateAuthActionsConfig) => {
|
||||||
const {
|
const {
|
||||||
authUrl,
|
authUrl,
|
||||||
storage,
|
|
||||||
userAttributes,
|
userAttributes,
|
||||||
userRegistrationAttributes,
|
userRegistrationAttributes,
|
||||||
} = config
|
} = config
|
||||||
|
|
||||||
const Storage: DeviceStorage = Boolean(storage.flushGetRequests) ? storage : AsyncLocalStorage
|
const Storage: DeviceStorage = AsyncLocalStorage
|
||||||
|
|
||||||
const registerUser = (
|
const registerUser = (
|
||||||
userRegistrationDetails: UserRegistrationDetails,
|
userRegistrationDetails: UserRegistrationDetails,
|
||||||
|
|
|
@ -220,3 +220,9 @@ export interface DeviceStorage {
|
||||||
readonly multiGet: (keys: string[]) => Promise<any>
|
readonly multiGet: (keys: string[]) => Promise<any>
|
||||||
readonly multiSet: (keyValuePairs: string[][]) => Promise<any>
|
readonly multiSet: (keyValuePairs: string[][]) => Promise<any>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GenerateAuthActionsConfig {
|
||||||
|
authUrl: string
|
||||||
|
userAttributes: {[key: string]: any}
|
||||||
|
userRegistrationAttributes: {[key: string]: any}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user