Supabase/Redwood -- The Morning After

Hello,

When I (or my testers) come back to my app, after having been logged in w/Google the night before, they can not easily login again.

It’s timed out and want’s login again, but nothing short of a refresh will actually show anything

The Auth playground has the same problem (I think) which is interesting, because I haven’t visited it in a long while…

There is an error in the AP console

AuthError.js:22 Uncaught (in promise) AuthError: Unexpected error in authentication.: Hash does not contain state.
    at new t (AuthError.js:22)
    at Function.t.createUnexpectedError (AuthError.js:30)
    at e.getResponseState (UserAgentApplication.js:1125)
    at new e (UserAgentApplication.js:94)
    at Object.423 (AzureActiveDirectory.js:8)
    at u (bootstrap:84)
    at Module.836 (6.c7b97436.chunk.js:2)
    at u (bootstrap:84)
    at async f.startPageLoadTransition (page-loader.js:89)

If I understood more about this Auth stuff, I might wonder if I should “refresh” my token?

Perhaps this guy is on to it: How can I refresh the provider_token? · Discussion #2260 · supabase/supabase · GitHub

WWL

(wait, watch, learn)

That error in AP is specific to its implementation because it loads all the auth providers (Supabase, Netlify, Azure, Magic Link, etc),

You can see here the error is about Azure ActiveDirectory – this is not part of Supabase.

Can you share the error you see in your app instead?

The Supabase client should try to use refresh tokens to reauthenticate you.

Also, you can set the JWT expiration value in Supase’s Auth dashboard to be longer if you so desire.

Well there’s the fun – I don’t get an error.

The Supabase component renders and says it’s authenticated, then again and says it is not.

Since it’s not I render the Login button - which goes to the Supabase component

lather, rinse, repeat

  1. arrive at Home via routing on empty path
      <Route path="/" page={HomePage} name="home" />
  1. get offered a login for not being authenticated
  return isAuthenticated ? (
    <Redirect to={routes.working()} />
  ) : (
    <Box className={classes.comfortable}>
      <Box className={classes.comfortable}>To use our services you need to login.</Box>
      <Button variant="contained" color="primary" size="large" className={classes.buttonMargin} startIcon={<PowerSettingsNewIcon />} onClick={() => navigate(routes.login())}>
        Login
      </Button>
    </Box>
  )
  1. login page uses Supabase
  ? (
    <Redirect to={routes.home()} />
  )
  : (
      <Supabase />
  )
  1. and there is - I think, my problem… Man, nothing helps like explaining it to somebody…

Nope, still not solved…

No errors, just no login after a few hours away…