We make use of the Security library to ensure the safe functioning and authorization management of our application.
This library is mainly responsible for validating the user session and granting access permissions to each of our app views and functionalities.
It also plays a huge role in the Ocean integration process.
Explore the primary components that make up Oasis Security and its relation to the Ocean integration.
Follow the link below to learn more about Oasis Security API reference.
‣
Learn how to run the Oasis Security locally to develop and to decode/encode payloads.
Oasis Security helpers are reusable classes that provide common functionalities within our app. They simplify development tasks, promote code consistency, and improve maintainability.
In this section, we'll learn how to install and use Oasis Security in a frontend app and library/component.
npm i @oasis/security
# or upgrade to the latest version
npm update @oasis/security
⚠️ The setup is different for apps and libraries/components.
...
import OasisSecurity, { OasisRender } from '@oasis/security';
import store from '@/store';
// Initialize the app with the following options
Vue.use(OasisSecurity, { store, initialize: true });
const vueLifeCycles = {
...
appOptions: {
// Modify the render as follows:
render(h) {
return OasisRender(h, App, {
props: {
name: this.name,
mountParcel: this.mountParcel,
singleSpa: this.singleSpa,
},
});
},
...
}
Usage in router
Add this to your router index.js