damienbod / angular-auth-oidc-client

npm package for OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow
https://www.npmjs.com/package/angular-auth-oidc-client
MIT License
1.11k stars 418 forks source link

feat: add authenticated and userData signals #1937

Closed timdeschryver closed 2 weeks ago

timdeschryver commented 3 weeks ago

I had some time so I wanted to try-out signals within this library.

This PR adds two signals for the most common/used methods (from my perspective), which are isAuthenticated$ and userData$. I've just wrapped the observable with toSignal.

I've updated the standalone example app to test it out.

Thoughts? I can also convert this into an issue.

Anonymous: image

Authenticated: image

FabianGosebrink commented 2 weeks ago

Thanks for this PR. I think it is a nice addition to move towards signals. Thanks!!!