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

onAuthenticated and getUser callbacks #3

Open
orar opened this issue Jul 4, 2020 · 0 comments
Open

onAuthenticated and getUser callbacks #3

orar opened this issue Jul 4, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@orar
Copy link

orar commented Jul 4, 2020

I'm using, in a project, react-sanctum and it feels great. In the meanwhile, callbacks like onAuthenticated() and getUser() on Sanctum and withSanctum could be of great use.

<Sanctum
    checkOnInit
    config={} 
    onAuthenticated={(user,....) => {}} 
>
    <SubAppComponents />
</Sanctum>
const SubAppComponents = ({user, getUser, authenticated } ) => {
    // refresh user object
    if (condition) getUser() 
    
    return ..... 
}

export default withSanctum(SubAppComponents) 

What do you think?

@koole koole added the enhancement New feature or request label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants