OasisAuth

This class exposes Oasis Security’s vuex store, to allow the frontend applications to access its stored user data.

Get user data

Get data as username, email, permission names the user has with the getters as follows:

import { OasisAuth } from '@oasis/security';

computed: {
  ...mapGetters(OasisAuth.STORE_MODULE_AUTH, {
    userName: '@getters/getUsername',
    email: '@getters/getEmail',
		permissionStrings: '@getters/getPermissions',
  }),
}

OasisHelperToken

Oasis helper token is a class that exposes methods to get the user current session data.

Get user tokens

Get the user ID token.

const idToken = OasisHelperToken.getTokenUser()

Or get the user ID token and refresh token

const { id, refresh } = OasisHelperToken.getTokenAuthData()

Get account ID

Get the user account ID

const accountId = OasisHelperToken.getAccountId()

Get permissions IDs

Get the permissions ID (numbers) the user has.

const permissionIds = OasisHelperToken.getMavUserPermissionIds()

OasisAxios

Oasis axios is an axios instance with an interceptor that refreshes the bearer token inside the outcoming request.