Auth-module: Nuxt internal server error

Created on 8 Dec 2020  路  3Comments  路  Source: nuxt-community/auth-module

Version
4.9.1
Reproduction link
none
Steps to reproduce
none
What is expected ?
Internal Server Error is displayed on the secure page when unauthorized
What is actually happening?
The errorPage and login pages are available. This only happens in build on prod when domain is available. But if you enter by server ip, then everything is fine. And on localhost everything is fine.

If you log in, you can open all pages through nuxt-link. But accessing directly via url results in 500 error.
At the moment of direct access to the protected page, a 401 status response from the server is returned.
Additional comments?
part of nuxt.config.js
``` axios: {
baseURL: process.env.API_URL || 'http://localhost:8000/api/'

},
auth: {
redirect: {
login: '/login',
logout: false,
callback: '/',
home: '/',
},
rewriteRedirects: true,
watchLoggedIn: true,
strategies: {
local: {
token: {
property: 'access_token',
maxAge: 1800,
// type: 'Bearer'
},
endpoints: {
login: { url: '/auth/login', method: 'post', propertyName: 'access_token' },
logout: false,
user: { url: '/auth/profile', method: 'get', propertyName: false },
},
tokenRequired: false,
tokenType: false,

  }
},

},

router: {
middleware: ['auth']
},
```

Most helpful comment

Can you please post a repro? You can use this as a base: https://codesandbox.io/s/nuxt-auth-demo-45icg

All 3 comments

API and Client on the same domain

Can you please post a repro? You can use this as a base: https://codesandbox.io/s/nuxt-auth-demo-45icg

Can you please post a repro? You can use this as a base: https://codesandbox.io/s/nuxt-auth-demo-45icg

It was my mistake I forgot to turn off the VPN on the server. And the request was not between Do褋ker containers, but directly to the domain.

Was this page helpful?
0 / 5 - 0 ratings