Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App logs out from google-oauth2 connection a second after the page refresh #91

Open
goutham1706-dev opened this issue Aug 16, 2020 · 1 comment

Comments

@goutham1706-dev
Copy link

This is a little weird, my gatsby app for some reason logs out a few seconds after refresh. A normal username-password-authentication connection works fine. The following is the state a second after the refresh:

authResult: null,
error: {
  code: "login_required", 
  description: "Login required"
  error: "login_required"
  error_description: "Login required",
  original: {
    error: "login_required", 
    error_description: "Login required
  }
},
errorType: "checkSession",
expiresAt: null,
isAuthenticating: false,
user: {}

auth0_callback

import React, { useEffect } from "react"
import { useAuth } from "react-use-auth"
import Layout from "../components/layout"

const AuthCallback = () => {
  const { handleAuthentication } = useAuth()
  useEffect(() => {
    handleAuthentication({ postLoginRoute: "/" })
  }, [])
  return <Layout>Redirecting to home...</Layout>
}

export default AuthCallback
@benheb
Copy link

benheb commented Nov 1, 2020

@goutham1706-dev Have you found a solution for this? I think I might be running into the same thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants