I'm currently in the process of incorporating the 'Nuxt Auth Module' into my Nuxt App.
After setting up my Proxy & Auth Modules and establishing the 'Local Strategy,' I encountered some confusion.
Although my 'Login' endpoint is functioning correctly, with the 'propertyName' set to 'access_token' where the token value resides, I am puzzled by the workings of the 'User' endpoint.
The provided example is as follows:
auth: {
strategies: {
local: {
endpoints: {
login: { url: '/api/auth/login', method: 'post', propertyName: 'token' },
logout: { url: '/api/auth/logout', method: 'post' },
user: { url: '/api/auth/user', method: 'get', propertyName: 'user' }
},
tokenRequired: true,
tokenType: 'bearer'
}
}
}
My configuration aligns closely with this setup. How does the 'User' endpoint identify the logged-in user?
In my case, I am using a third-party authentication system for integration purposes. Their REST 'User' endpoint necessitates an 'ID' or 'UserName' to fetch user details.
Given that my 'Login' response includes a 'UserName,' I believe it can be utilized to call the subsequent User endpoint if I comprehend the process.
If anyone has insights on how the User endpoint functions, I could greatly benefit from guidance:
user: {
url: '/users/${userId}',
method: 'get',
propertyName: 'data'
}