-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuxt.js #356
Comments
Hey,
Ya, I never got far with it, and gave up.
…On Sun, Apr 15, 2018, 04:49 Nikolay ***@***.***> wrote:
Hi,
I found demo with Nuxt.js example, but looks like it's not finished.
Is there any way to use it with Nuxt.js? Working Middleware?
I my nuxt config I have these plugins:
plugins: [
{src: '~plugins/vue-bootstrap', ssr:false},
{src: '~plugins/vue-resource', ssr:false},
{src: '~plugins/vue-auth', ssr:false}
],
ssr is disabled for them.
The plugin itself:
import Vue from 'vue';
import VueAuth from ***@***.***/vue-auth';
export default (router) => {
Vue.router = router.app.router;
Vue.use(VueAuth, {
auth: ***@***.***/vue-auth/drivers/auth/bearer.js'),
http: ***@***.***/vue-auth/drivers/http/vue-resource.1.x.js'),
router: ***@***.***/vue-auth/drivers/router/vue-router.2.x.js'),
});
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#356>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkcy13xADV7YmlwzhtxtWx6QlmHbDz-ks5tom7ngaJpZM4TVPS3>
.
|
Ya, I'm not really sure, and it's been a while since I took a look at Nuxt
anyway.
…On Sun, Apr 15, 2018 at 11:06 PM, Nikolay ***@***.***> wrote:
As far as I understand we don’t have a router config in NUXT so there is
no way to set priveldges?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#356 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkcyx9h8yc8GwmuDFgcmFlTNOUhldvTks5to3AbgaJpZM4TVPS3>
.
|
I found a way to hook into routes. It is actually documented, but the main problem is the order when the plugins are initiated. It just doesn't work when we put vue-auth into plugin export, but when it's outside, the router and other stuff is not defined yet. I gave up with the integration and wrote my own solution based on nuxt middlewares and vuex. |
@nikolaynesov do you still use that solution you wrote? @websanova did the pr solve the problem? |
I was trying https://auth.nuxtjs.org/ but i find more complete vue-atuh library, i'll try some examples. |
For those who are still having trouble configuring Vue Auth with Nuxt 2, I've found a solution: First of all, install Then, add
Next, create a plugin. In this plugin, you need to import
The Now, you just need to import the plugin in your
And that should be it! Remember to |
Hi,
I found demo with Nuxt.js example, but looks like it's not finished.
Is there any way to use it with Nuxt.js? Working Middleware?
In my nuxt config I have these plugins:
ssr is disabled for them.
The plugin itself:
The text was updated successfully, but these errors were encountered: