-
Notifications
You must be signed in to change notification settings - Fork 111
5. Action Creators & Constants
This package offers a number of redux action creators and constants to manage OIDC interactions with your redux app.
import { userExpired, redirectSuccess, userFound, silentRenewError, sessionTerminated, userExpiring, userSignedOut } from 'redux-oidc';
All of these action creators are used by this package. The actions are dispatched by the oidcMiddleware
, CallbackComponent
& on UserManager
events.
Payload: none
Dispatched when: current user is expired
Effects: reducer sets user to null
.
Payload: user - the newly obtained user.
Dispatched when: redirection callback succeeded in CallbackComponent
.
Effects: reducer sets the user property.
Payload: user - the found user.
Dispatched when: an existing user has been found during startup of the middleware.
Effects: reducer sets the user.
Payload: error the error thrown by silent renew.
Dispatched when: silent renew fails.
Effects: reducer sets user to null
.
Payload: none
Dispatched when: the current session is terminated (user is logged out).
Effects: reducer sets user to null
Payload: none
Dispatched when: the current user is expiring (right before silent renew is triggered, if configured).
Effects: none
Payload: none
Dispatched when: the loading process of a new user starts.
Effects: sets isUserLoading
to true
Payload: none
Dispatched when: the user signs out.
Effects: user
is set to null, isLoadingUser
is set to false.
The following constants are used with the action creators:
import { USER_EXPIRED, REDIRECT_SUCCESS, USER_FOUND, SILENT_RENEW_ERROR, USER_EXPIRING, SESSION_TERMINATED, LOADING_USER, USER_SIGNED_OUT } from 'redux-oidc';