Closed iamh2o closed 8 months ago
screenshot of the chrome console
I just merged a bunch of small changes into main (which is not stable exactly, but is now passing tests). Please pick up from there.
@jdurham38 -- UPDATE
I was not starting the fastapi server on port 58080, which was driving this error as the port had no service running on it!
NEW PROBLEM I can now authenticate with github and google.
However, the login session does not stick.
After successful authorization, when I try to navigate to an auth required page, I get bounced back to login
.
When I logout
and then login
via the user specified email route, this works.
Here is the uvicorn log for a successful auth via google
uvicorn main:app --reload --port 58080
INFO: Will watch for changes in these directories: ['/Users/daylily/projects/daylily_repos/bloom']
INFO: Uvicorn running on http://127.0.0.1:58080 (Press CTRL+C to quit)
INFO: Started reloader process [3608] using StatReload
INFO: Started server process [3610]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: 127.0.0.1:55364 - "GET / HTTP/1.1" 200 OK
INFO: 127.0.0.1:55364 - "GET /login HTTP/1.1" 200 OK
INFO: 127.0.0.1:55364 - "GET /logout HTTP/1.1" 303 See Other
INFO: 127.0.0.1:55364 - "GET / HTTP/1.1" 200 OK
INFO: 127.0.0.1:55366 - "GET /admin?dest=skin HTTP/1.1" 307 Temporary Redirect
INFO: 127.0.0.1:55366 - "GET /login HTTP/1.1" 200 OK
INFO: 127.0.0.1:55366 - "GET /assays?show_type=accessioning HTTP/1.1" 307 Temporary Redirect
INFO: 127.0.0.1:55366 - "GET /login HTTP/1.1" 200 OK
INFO: 127.0.0.1:55379 - "GET / HTTP/1.1" 200 OK
INFO: 127.0.0.1:55388 - "POST /oauth_callback HTTP/1.1" 303 See Other
INFO: 127.0.0.1:55388 - "GET / HTTP/1.1" 200 OK
And then if I try to visit assays
, this is the log:
INFO: 127.0.0.1:55475 - "GET /assays?show_type=accessioning HTTP/1.1" 307 Temporary Redirect
INFO: 127.0.0.1:55475 - "GET /login HTTP/1.1" 200 OK
Ok- It appears that the problem is in the redirect back to /
following oauth
. The request.session data is somehow cleared between the return from oauth and the redirect to /
. This request.session is not reset using the direct email login path.
I checked in a few additional small tweaks to help debug this.
@jdurham38 --
I figured it out, when I modified this code
if (accessToken) {
// Send the code to the backend
fetch('http://0.0.0.0:58080/oauth_callback', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ accessToken: accessToken }),
})
to not include 0.0.0.0:port
, things work as expected
if (accessToken) {
// Send the code to the backend
fetch('/oauth_callback', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ accessToken: accessToken }),
})
I ran through the SUPABASE_CONFIG.md, and setup both github and google supabase services. Which appeared partially successful? When logging in via github and google, the appropriate login windows appear, and I can select my gh or goog user i wish to login as. However, then a chrome alert pops up telling me there was a github login error (even if I use the google login path).
chrome alert error:
Poking in the code, this error is raised from this js:
I pinged this url
http://0.0.0.0:58080
, and found nothing running. Is this expected?If I wanted to login with github, then logout and login with google, is this possible?