redux-modules-aws-cognito
v0.9.0
Published
AWS Cognito for React apps using redux and redux-saga.
Downloads
8
Readme
redux-modules-aws-cognito
AWS Cognito for React apps using redux and redux-saga.
Install
$ npm install --save redux-modules-aws-cognito
Usage
import myModule from 'redux-modules-aws-cognito'
myModule()
API
lastAuthUserAccessToken
LAST AUTH USER TOKENS
userSession
USER SESSION
userSessionAccessToken
USER SESSION TOKENS
userAccessToken
DEFAULT SESSION TOKENS
NOTE setting this up to return userSession tokens if available and then return lastAuthUser tokens if not.
NOTE for now I am using what is in storage pool until I understand how to properly use tokens in different scenarios (loading session from local storage & logging in)
State
Action Payloads
Type: {info: {user: {}?, signInUserSession: {idToken: {jwtToken: string}?, refreshToken: {token: string}?, accessToken: {jwtToken: string}?}?}, error: {message: string?}, hasSignedUp: boolean, isAuthenticating: boolean, isConfirmed: boolean, isAuthenticated: boolean, needConfirmCode: boolean, needMFA: boolean, needNewPassword: boolean}
Properties
info
{user: {}?, signInUserSession: {idToken: {jwtToken: string}?, refreshToken: {token: string}?, accessToken: {jwtToken: string}?}?}info.user
{}?info.signInUserSession
{idToken: {jwtToken: string}?, refreshToken: {token: string}?, accessToken: {jwtToken: string}?}?info.signInUserSession.idToken
{jwtToken: string}?info.signInUserSession.idToken.jwtToken
stringinfo.signInUserSession.refreshToken
{token: string}?info.signInUserSession.refreshToken.token
stringinfo.signInUserSession.accessToken
{jwtToken: string}?info.signInUserSession.accessToken.jwtToken
stringerror
{message: string?}error.message
string?hasSignedUp
booleanisAuthenticating
booleanisConfirmed
booleanisAuthenticated
booleanneedConfirmCode
booleanneedMFA
booleanneedNewPassword
boolean
PayloadLogIn
Action Payloads
Type: {email: string, password: string, code: string?, newPassword: string?}
Properties
ActionLoadSession
Action Types
Type: {type: "@@awsCognito/LOAD_SESSION"
}
Properties
type
"@@awsCognito/LOAD_SESSION"
Action
Action Union Type
Type: (ActionLoadSession | ActionLoadSessionFailed | ActionLoadSessionSuccess | ActionLogIn | ActionLogInFailed | ActionLogInSuccess | ActionLogInRequireMFA | ActionLogInRequireNewPassword | ActionLogOut | ActionLogOutFailed | ActionLogOutSuccess | ActionResetState | ActionSetState | ActionSignUp | ActionSignUpFailed | ActionSignUpSuccess)
License
MIT © OMT Tech