Tag
Authentication
4 posts tagged Authentication.
Posts

09/02/2026
An Angular auth interceptor, the functional way
Attach a token to every outgoing request and handle a 401 in one place, using the functional HttpInterceptorFn rather than the class-based interceptor most search results still show.

09/02/2026
is_granted in Twig: roles and IS_AUTHENTICATED
is_granted takes more than roles, and picking the wrong one gives you a check that quietly passes when it should not. What each attribute tests, why role hierarchy makes ROLE_USER true for your admins, and where the check belongs.

09/02/2026
Leaving FOSUserBundle: what replaces each piece
The bundle is maintained only enough for existing projects to migrate off it. Every piece it provided now has a replacement in Symfony itself or in two small bundles - and the migration is mostly deletion.

04/28/2015
Show the logged-in user in a Twig template
The snippet everyone has saved uses app.user.username, which throws on every supported Symfony. Here is the version that works, which check to guard it with, and how to greet somebody by name rather than by email address.