React social login button example

Next step would be to add logic on your callback route that looks something like the following (copied from our AuthJS docs):

if (authClient.isLoginRedirect()) {
  // callback flow
  await authClient.handleLoginRedirect();
} else {
  // normal app flow
}

This will let your app take the token returned in the hash fragment and store it in the TokenManager, so that you can use methods like isAuthenticated to determine if the user is already logged in with valid/active tokens.

1 Like