Skip to content

[Bug]: OAuth sometimes doesn't properly handle errors on Token #411

@jonas-martinez

Description

@jonas-martinez

What happened?

OAuth sometimes doesn't properly handle errors related to the token.

In my case, it opens the OAuth popup and tries to authenticate with an already existing token from my browser. An error occurs while trying to authenticate with that token because it might be invalid.

In my opinion, when any error (that is not network related) occurs during the authentication process using an existing token, the user should be redirected to the login/register page and any existing token or authentication variable linked to the user locally should be deleted.

EDIT ⚠️

I tried to run the website in private mode but it seems that I get the same error. This issue might not be related to the token based on this behaviour.

What browsers are you seeing the problem on?

Chrome (or chrome-based)

Version

secrets

Relevant log output

This is a part of the logs from the backoffice instance (staging).

10.2.2.24 - - [29/May/2024:19:20:07 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=eIAMLGvWbEFnAjwfCrYnXLiGa HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:08 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=ZOreAphX31DkPGNHrxEiMNtSn HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:09 +0000] "GET /flutter_service_worker.js?v=1381983284 HTTP/1.1" 304 0 "https://dev.staging.lenra.io/flutter_service_worker.js?v=1381983284" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:10 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=sy71tO9VLtvsbfrMkVWJQSvov HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:10 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=0259010820481286811629968 HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:11 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=wq6kPt0K448360Z7Z9x5171H5 HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:11 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=JREDujavEtkDjQLFHCYDwgTFI HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:12 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=g9sL58Cngxt4h0gNi9e2sO69X HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:12 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=39kipvyczkxkiovz4M4qdyizh HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:12 +0000] "GET /redirect.html?error=error&error_description=The+error+is+unrecognizable&state=52583g1800126197677310259 HTTP/1.1" 200 245 "https://dev.staging.lenra.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"
10.2.2.24 - - [29/May/2024:19:20:13 +0000] "GET /flutter_service_worker.js?v=1381983284 HTTP/1.1" 304 0 "https://dev.staging.lenra.io/flutter_service_worker.js?v=1381983284" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "51.178.59.209"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    🟤 Can wait

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions