leepeuker / movary

Self hosted web app to track and rate your watched movies
MIT License
388 stars 14 forks source link

Add authentication check endpoint #582

Closed JVT038 closed 6 months ago

JVT038 commented 6 months ago

This PR adds an API endpoint to check if the user is authenticated or not. The path is /authentication/authenticated and it returns a JSON object with authenticated = false || true.

If the user is authenticated, the object will also include a username and userId property, with the values of the current username and ID.

This PR is based on #575 , so it has to be merged after that one.

JVT038 commented 6 months ago

BTW, the reason that I think this endpoint is necesssary, is because there's currently no way for the new Vue frontend to figure out whether the user is authenticated or not. Additionally, if the user was authenticated, the frontend still can't figure out which user is authenticated.