Module

auth

Provides a possibility to work with user authentication and login screen.

View Source auth/auth-actions.js, line 8

Methods

# static authRequired()

Authenticates the user based on the saved data in the system.

Therefore before calling this action, you need to save information about the current user with help of {setLoggedInUser} action.

Properties:
Name Type Description
type string

AUTH_REQUIRED

View Source auth/auth-actions.js, line 23

# static logout()

Calls API to logout the current user and wipes all information about logged in user from Redux store.

Properties:
Name Type Description
type string

LOGOUT

View Source auth/auth-actions.js, line 30

# static setImageDataUrl(imageDataUrl)

When user loses the session we make the page not accessible and display the modal window to re-authenticate. On top of that we also make the page blurred with help of the image. This action specifically dedicated to define that image.

Parameters:
Name Type Description
imageDataUrl string

The URL to an image which will be layered on top of the whole page

Properties:
Name Type Description
type string

SET_IMAGE_DATA_URL

View Source auth/auth-actions.js, line 42

# static setLoggedInUser(username, viewAs, loginProviders)

Saves the information about logged in user.

Parameters:
Name Type Description
username string

the name of currently logged in user.

viewAs object

Represented as {user, roles}, where user is string and roles - array of strings.

loginProviders object

Structure of the object is {isLocalUrl, loginUrl, logoutUrl}. loginUrl - is the link which will be called when user sign in. logoutUrl - is the link which will be called when user sign out. isLocalUrl - specifies if XLD has enabled or disabled SSO.

Properties:
Name Type Description
type string

SET_LOGGED_IN_USER

View Source auth/auth-actions.js, line 58

# static setReAuthentication(reAuthentication, reAuthenticationMessage, reAuthenticationDescription)

Notifies the user that the session is lost and requires to reauthenticate. At this case the appropriate modal window is displayed and the main page is blurred, so no actions are allowed and nothing is visible.

Parameters:
Name Type Description
reAuthentication boolean

if true, displays re-authentication modal window

reAuthenticationMessage string

a title of the modal window

reAuthenticationDescription string

a description in the modal window explaining to the user what is happening now.

Properties:
Name Type Description
type string

SET_RE_AUTHENTICATION

View Source auth/auth-actions.js, line 78

# static submitCredentials(password, rememberMe, username)

Submits provided credentials of the user for singing in to the system.

Parameters:
Name Type Description
password string

password credential of the user

rememberMe boolean

should the session be saved in rememberMe cookie

username string

login credential of the user

Properties:
Name Type Description
type string

SUBMIT_CREDENTIALS

View Source auth/auth-actions.js, line 95