Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Updating current user does not update AuthState #47

Open
frinzekt opened this issue Jan 23, 2021 · 1 comment
Open

Updating current user does not update AuthState #47

frinzekt opened this issue Jan 23, 2021 · 1 comment
Labels
bug Something isn't working client client related issue

Comments

@frinzekt
Copy link
Member

When the current user is being editted in the administrator view, the navbar with the current permission does not update.

Weird bug happens because for some random reason,
featherClient.reAuthenticate has to be done twice in order to get the updated information of the current user.

This idea came from #45 where a user has been updated by an after hook and needs to be refreshed in order to redirect the user to the page where authguard will take effect.

Some idea of implementation is around:
coordinator/UserModal.js

    const handleSave = () => {
        const { perms } = modalState
        services.users.patch(user._id, { perms })

        // Update User Permission in interface if same user
        if(authUser._id === user._id){
            dispatch(signIn(true))
        }
    }
@frinzekt frinzekt added bug Something isn't working client client related issue labels Jan 23, 2021
@frinzekt
Copy link
Member Author

There was a tiny fix introduced in not sure when (git blame says #58, but that is refactoring). The fix was to do a forceUpdate, this is only a temporary fix that works in some cases but not al

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working client client related issue
Projects
None yet
Development

No branches or pull requests

1 participant