Skip to content

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

@goutham1706-dev

Description

@goutham1706-dev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions