You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
route /profile need require user have the token. If there is no token return 401
route /feed allow public access, but if user sends token in the header, it will return additional information(specific to this user) in the response.
Will the following code give me the expected result without side effects? Is this a good practice ? Or, should I add each case to specific route in the routes file ?
Hi all,
I have the following scenarios:
/profile
need require user have the token. If there is no token return 401/feed
allow public access, but if user sends token in the header, it will return additional information(specific to this user) in the response.Will the following code give me the expected result without side effects? Is this a good practice ? Or, should I add each case to specific route in the routes file ?
So far, I tested the code with those 2 routes, it's working well.
But I have many more routes and I haven't tested 1 by 1 yet.
The text was updated successfully, but these errors were encountered: