OAUTH Discord id_token Lifetime & Refresh Token Handling

I'm using better-auth with Discord OAuth2 and need a SpacetimeDB connection to persist longer than the id_token's 1-hour lifetime. Currently, I retrieve the id_token from orpc.user.getTokenId after initial sign-in. My issue is that this id_token expires, leading to Disconnects. Does better-auth handle the OAuth2 refresh token flow internally? If so, how can I access or trigger a refresh of the user's session and obtain a new, valid id_token without re-authenticating the user? My goal is a seamless, long-lived session for my users. Or Do i Need to add my own OIDC
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?