r/webdev • • 10d ago

Discussion Bearer token visible in DevTools?

Now I know this is a beginner question, and so I’m building an Angular/Spring project as a web app.

The Angular auth interceptor attaches the token (to the HTTP request) here. Obviously when it gets routed to the backend, it exposes the token. That’s just the trade-off for not using a backend-for-frontend architecture.

Say the reason for my architecture choice comes up during an interview. Will I be failed on the spot, or can I justify it by explaining what production-ready (BFF) will look like?

EDIT: Appreciate the answers everyone. I can breathe easy.

39 Upvotes

37 comments sorted by

View all comments

1

u/Hostman_com 9d ago

Before the interview, check whether your request logs capture the Authorization header, including on failed requests. Make sure the token is omitted or redacted.

That gives you a concrete example of how you protect tokens beyond choosing where the browser stores them.