AWS Cognito for React apps using redux and redux-saga.
$ npm install --save redux-modules-aws-cognito
import myModule from 'redux-modules-aws-cognito'
myModule()
LAST AUTH USER TOKENS
USER SESSION
USER SESSION TOKENS
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)
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
Action Payloads
Type: {email: string, password: string, code: string?, newPassword: string?}
Properties
Action Types
Type: {type: "@@awsCognito/LOAD_SESSION"
}
Properties
type
"@@awsCognito/LOAD_SESSION"
Action Union Type
Type: (ActionLoadSession | ActionLoadSessionFailed | ActionLoadSessionSuccess | ActionLogIn | ActionLogInFailed | ActionLogInSuccess | ActionLogInRequireMFA | ActionLogInRequireNewPassword | ActionLogOut | ActionLogOutFailed | ActionLogOutSuccess | ActionResetState | ActionSetState | ActionSignUp | ActionSignUpFailed | ActionSignUpSuccess)
MIT © OMT Tech