I have the following code looking to redirect from login form in the frontend after successful authentication:
useEffect(() => {
const subscription = authActor.subscribe((observer) => {
// authentication onDone, if loggedIn redirect
});
return () => {
subscription.unsubscribe();
};
}, [authActor]);
In v4 we were looking at the actual observer event being fired (but speaking with David this was an anti-pattern):
if (observer.event.type === 'done.invoke.auth.authenticating:invocation[0]') {
What is the "proper" way to handle this in v5?