Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add AuthState via reducer #583

Closed
pamapa opened this issue Apr 10, 2021 · 1 comment
Closed

add AuthState via reducer #583

pamapa opened this issue Apr 10, 2021 · 1 comment

Comments

@pamapa
Copy link
Contributor

pamapa commented Apr 10, 2021

something like:

export interface AuthState {
  user?: User;
  isAuthenticated: boolean;
  isLoading: boolean;
  error?: Error;
}

inside the context:

const [state, dispatch] = useReducer(reducer, initialAuthState);

Additionally a AuthReducer.tsx file is handling the reducing. I could put together a merge request, iff wanted.

@simenandre
Copy link
Member

simenandre commented Jul 21, 2021

Thanks for opening this issue, @pamapa. I'm closing this now, but we'll use this for reference in regards to #652.

For reference, @pamapa have made a separate library that adds this. So, if you are looking for such functionality, have a look at: https://github.com/pamapa/react-oidc-context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants