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