Authentication

|-/redux
    |
    |-/auth
        |- index.ts
        |- AuthSlice.ts
        |- AuthThunks.ts
Initial State
const initialState: SliceState = {
  email: null,
  accessToken: null,
  expiration: null,
  refreshToken: null,
  id: null,
  loginService: null,
  newUserRegistered: false,
  registerUserIsLoading: false,
  newUserRegisterError: false,
  loginUserIsLoading: false,
  emailVerified: false,
};
Selectors
  • getAccessToken: retrieves the token with which the user authenticated in the application will be able to consume the backend services.

  • getUserId: retrieves the unique id that identifies the authenticated user in the application.

  • getUserEmail: retrieves the email of the authenticated user in the application.

  • getUserEmailVerified: retrieves a boolean that determines if the email was verified.

  • getTokenExpiration: retrieves a string with the authenticated user's token expiration date.

  • getRefreshToken: retrieves the authenticated user's token with which they can re-request a valid token.

Last updated