In this section, we'll learn how to install and use Oasis Security.

‼️ Changes in nomenclature

We changed helpers and the vuex module names.

Here’s a list of the helpers that changed.

⬅️Before

MasivAxios MasivStorage MasivEncrypt MasivHelperToken MasivAuth MasivValidationToken

✅ Now

OasisAxios OasisStorage OasisEncrypt OasisHelperToken OasisAuth OasisValidationToken

The new name of the vuex module is oasis-security.

Installation

if you use @masiv/security you need to remove it

npm uninstall @masiv-addon/security

If you have the npmrc token up to date (see Adding token to connect to Azure Artifacts) you can install the Security library by running the npm command:

npm i @oasis/security

# or upgrade to the latest version

npm update @oasis/security

Now, go ahead and import the library in the main.js file of your project src folder as follows:

...

import OasisSecurity from '@oasis/security';

//You must pass the app store as parameter
Vue.use(OasisSecurity, { store, initialize: true });

If you are using Helpers

You need change name of the helpers

import { 
OasisAxios
OasisStorage
OasisEncrypt
OasisHelperToken
OasisAuth
OasisValidationToken } from '@oasis/security';

OasisAuth.middlewareLogged({ to, from, next }, payload);
OasisHelperToken.getTokenAuthData().id;
OasisHelperToken.getTokenUser();
OasisAxios.instance({...})

Oasis Helpers