Skip to content

Commit

Permalink
chore(sso): auth selectors typed
Browse files Browse the repository at this point in the history
  • Loading branch information
0xs34n committed Sep 27, 2021
1 parent 8b08fad commit da159ea
Showing 1 changed file with 50 additions and 16 deletions.
66 changes: 50 additions & 16 deletions packages/blockchain-wallet-v4-frontend/src/data/auth/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,55 @@ import { path } from 'ramda'

import { RootState } from 'data/rootReducer'

import { WalletDataFromMagicLink } from './types'
import { AuthStateType } from './types'

export const isAuthenticated = path(['auth', 'isAuthenticated'])
export const getRegistering = path(['auth', 'registering'])
export const getFirstLogin = path(['auth', 'firstLogin'])
export const getRestoring = path(['auth', 'restoring'])
export const getAuthType = path(['auth', 'auth_type'])
export const getDesignatedProduct = path(['auth', 'designatedProduct'])
export const getSecureChannelLogin = path(['auth', 'secureChannelLogin'])
export const getLogin = path(['auth', 'login'])
export const getMobileLoginStarted = path(['auth', 'mobileLoginStarted'])
export const getRegisterEmail = path(['auth', 'registerEmail'])
export const getMetadataRestore = path(['auth', 'metadataRestore'])
export const getKycResetStatus = path(['auth', 'kycReset'])
export const getAccountReset = path(['auth', 'resetAccount'])
export const isAuthenticated: (state: RootState) => AuthStateType['isAuthenticated'] | undefined =
path(['auth', 'isAuthenticated'])
export const getRegistering: (state: RootState) => AuthStateType['registering'] = path([
'auth',
'registering'
])
export const getFirstLogin: (state: RootState) => AuthStateType['firstLogin'] | undefined = path([
'auth',
'firstLogin'
])
export const getRestoring: (state: RootState) => AuthStateType['restoring'] = path([
'auth',
'restoring'
])
export const getAuthType: (state: RootState) => AuthStateType['auth_type'] | undefined = path([
'auth',
'auth_type'
])
export const getDesignatedProduct: (
state: RootState
) => AuthStateType['designatedProduct'] | undefined = path(['auth', 'designatedProduct'])
export const getSecureChannelLogin: (state: RootState) => AuthStateType['secureChannelLogin'] =
path(['auth', 'secureChannelLogin'])
export const getLogin: (state: RootState) => AuthStateType['login'] = path(['auth', 'login'])
export const getMobileLoginStarted: (
state: RootState
) => AuthStateType['mobileLoginStarted'] | undefined = path(['auth', 'mobileLoginStarted'])
export const getRegisterEmail: (state: RootState) => AuthStateType['registerEmail'] = path([
'auth',
'registerEmail'
])
export const getMetadataRestore: (state: RootState) => AuthStateType['metadataRestore'] = path([
'auth',
'metadataRestore'
])
export const getKycResetStatus: (state: RootState) => AuthStateType['kycReset'] = path([
'auth',
'kycReset'
])
export const getAccountReset: (state: RootState) => AuthStateType['resetAccount'] | undefined =
path(['auth', 'resetAccount'])
export const getMagicLinkData = (state: RootState) => state.auth.magicLinkData
export const getUserGeoData = path(['auth', 'userGeoData'])
export const getManifest = path(['auth', 'manifestFile'])
export const getUserGeoData: (state: RootState) => AuthStateType['userGeoData'] = path([
'auth',
'userGeoData'
])
export const getManifest: (state: RootState) => AuthStateType['manifestFile'] = path([
'auth',
'manifestFile'
])

0 comments on commit da159ea

Please sign in to comment.