Can't login with Discord #88
Labels
No labels
backend
bug
discord
do later
duplicate
enhancement
epic
frontend
good first issue
help wanted
need more info
question
top priority
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
daratine/gex#88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Trying to sign in with Discord takes me to
https://gex.honu.pw/auth/callback?code=IFp22BgH......with the following error:additional warning before the error:
WARN [AspNet.Security.OAuth.Discord.DiscordAuthenticationHandler] [CorrelationCookieNotFound] '.AspNetCore.Correlation.5UOMY7CEJtfm8pa<snip>' cookie not found.i'm able to login successfully. is there anything in the browser console that might indicate the error? does this consistently happen always? or did it start recently?
got a related issue, but i may have a hint, the callback_url is http and redirected to https.
Did somebody lately sign in for the first time?
here is mine:
yeah, this keeps popping up every once in a while and it seems like just trying again works? super inconsistent. would need to know browser and OS to see if there's a pattern
I get this 100% of the time on my phone using either Samsung Internet browser or Google Chrome browser. And 100% of the time on my windows 10 computer with Chrome or Edge. Have never been able to login.
{
"type": "/auth/callback",
"title": "internal server error: An error was encountered while handling the remote login.",
"status": 500,
"detail": "Microsoft.AspNetCore.Authentication.AuthenticationFailureException: An error was encountered while handling the remote login.\n ---> System.NullReferenceException: Object reference not set to an instance of an object.\n at gex.Startup.<>c.b__4_19(JsonElement user) in /home/gex/gex/gex/Startup.cs:line 195\n at Microsoft.AspNetCore.Authentication.OAuth.Claims.CustomJsonClaimAction.Run(JsonElement userData, ClaimsIdentity identity, String issuer)\n at Microsoft.AspNetCore.Authentication.OAuth.OAuthCreatingTicketContext.RunClaimActions(JsonElement userData)\n at AspNet.Security.OAuth.Discord.DiscordAuthenticationHandler.CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)\n at Microsoft.AspNetCore.Authentication.OAuth.OAuthHandler
1.HandleRemoteAuthenticateAsync()\n at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler1.HandleRequestAsync()\n --- End of inner exception stack trace ---\n at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler1.HandleRequestAsync()\n at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.ResponseCaching.ResponseCachingMiddleware.Invoke(HttpContext httpContext)\n at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\n at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\n at Microsoft.AspNetCore.RateLimiting.RateLimitingMiddleware.InvokeInternal(HttpContext context, EnableRateLimitingAttribute enableRateLimitingAttribute)\n at gex.Code.ExceptionHandlerMiddleware.Invoke(HttpContext context, ILogger1 logger) in /home/gex/gex/gex/Code/ExceptionHandlerMiddleware.cs:line 32","instance": "error:0a11b9da-d03e-4f5e-836d-bc40b69b3585",
"extensions": {}
}
After reading the code on line 195 in Startup.cs an guess is that the because I have never chosen an avatar on Discord. This might result in line 198 user.GetString("avatar")!.StartsWith("a_") to crash with a System.NullReferenceException: Object reference not set to an instance of an object. exeption. Note the "!" after GetString.
After uploading an avatar on Discord I can now login so it seems related to that.