Hi @pedramk. Using latest version (4.0.0) you can use plugins option to extend or access auth.
nuxt.config.js
{
modules: {
'@nuxtjs/auth'
},
auth: {
plugins: [ '~/plugins/auth.js' ]
}
}
plugins/auth.js:
export default function ({ app }) {
if (!app.$auth.loggedIn) {
return
}
const username = app.$auth.user.username
}
Most helpful comment
Hi @pedramk. Using latest version (4.0.0) you can use
pluginsoption to extend or access auth.nuxt.config.jsplugins/auth.js: