First of all this NOT AN ISSUE but a QUESTION. I tried this example an learn many things as a beginner. Thanks!
I want to build a simple app with register user, login, and an authenticated API to get the secured data.
Register the user and login work perfectly fine. And it stores in sessions collection in
And the /api/getallcategories API also has the sessionId in header as cookie:
I want to make /api/getallcategories as a secure API. (If sessionId is not there header cookie send back Unauthorized).
Or, If the current session is expired already I want to send back some response that logout the user in the Client?
First of all this NOT AN ISSUE but a QUESTION. I tried this example an learn many things as a beginner. Thanks!
I want to build a simple app with register user, login, and an authenticated API to get the secured data. Register the user and login work perfectly fine. And it stores in sessions collection in
And the
/api/getallcategories
API also has the sessionId in header as cookie:I want to make
/api/getallcategories
as a secure API. (If sessionId is not there header cookie send back Unauthorized). Or, If the current session is expired already I want to send back some response that logout the user in the Client?How can I do this? Any Help.