Hi,
I’m am unable to redirect users upon them signing in. I have also tried history.push. Could someone please tell me what I’m doing wrong?
Thanks in advance.
const redirect = (error: any) => {
if(!error){
return <Redirect to="/dashboard" />
} else if (error.error == 403){
setError('Invalid User Name or Password')
throw new Meteor.Error('Invalid User Name or Password', 'Invalid User Name or Password');
} else {
throw new Meteor.Error(error, error)
}
}
const selector = values.email;
const password = values.password;
Meteor.loginWithPassword(selector, password, function(error: any){
redirect(error)
});