In summary, we have implemented Vue
on the front-end and Hapi JS
on the back-end. The front end utilizes MSAL.js
for user authentication, passing an access token to the back-end. The access token is decoded using hapi-auth-jwt2
, with the validate()
function returning
{ isValid: true, credentials : { ps_ref: 12345, md_userid: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a1c0d2c7c0d2c6d2c6e1949996958fc2cecc">[email protected]</a> }}
. This information is then passed to the handler function of a route that retrieves authentication groups/user roles (i.e. Auids) from our database along with user data.
Consider the structure of the user object below:
{
Auids: (4) ["user", "webadmin", "accounts"]
md_clock: 5678
md_picture: "./images/"
ps_fname1: "Test Name"
ps_surname: "Test Surname"
psname: "Test Name Test Surname"
psref: 125125
}
We want to store this object in Vuex, but there are concerns about visibility to users with Vue Devtools or those who can execute something like rootElementOfApp.__vue__.$store
.
The questions at hand are:
How accessible is Vuex in production?
If Vuex is easily accessed by the public, is it the best option for storing this object? Should we consider encoding the user object or at least the Auids within it if we proceed with Vuex?