Skip to content

onAuthenticated and getUser callbacks #3

Open
@orar

Description

@orar

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions