I want to use a cookie based authentication, I can see some cookies created in the browser but the isAuthenticated state is not changing.
import useSignIn from 'react-auth-kit/hooks/useSignIn';
import useIsAuthenticated from 'react-auth-kit/hooks/useIsAuthenticated'
const signIn = useSignIn();
const isAuthenticated = useIsAuthenticated()
if (signIn({
auth: {
token: data.access_token,
type: 'Bearer',
expiresAt: data.expires_in
},
// refresh: data.refresh_token,
userState: { name: 'React User', uid: 123456 }
})) {
// Redirect or do-something
console.log('Success but is user authenticated : ', isAuthenticated);
handleClose();
}
Here are the cookies
cookies
New contributor
Ronald Chingambare is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.