Open kennedyngigi4 opened 2 years ago
You should add it to your this.$auth.loginWith()
method.
For example:
const userId = 'YourUserId'
// As get param
this.$auth.loginWith('local', params: { userId: userId }) // Results in /api/login?userId=YourUserId
// In url
this.$auth.loginWith('local', url: `/api/login/user/${userId}`) // Results in /api/login/user/YourUserId
The second prop in loginWith() overwrites your endpoints config which takes Axios request config.
user: { property: 'email', // autoFetch: true }, clientId: '', endpoints: { login: { url: 'login', method: 'post' }, logout: { url: 'logout', method: 'post' }, user: { url: 'user/'+<clientId here>, method: 'get' } }
This is part of my auth in nuxt.config.js How should I embed the clientId at the user endpoint? I am getting an error undefinedI have initialised it during login using => this.$auth.clientId = response['user_id']