Your question is Frontend Authentication and Authorization. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
How do you handle authentication and authorization at the frontend layer?
Keep your answer focused on a Salesforce web app, including how the UI should react to login state, token/session expiry, and permission changes. Explain what belongs in the frontend versus what must still be enforced server-side.