csound / web-ide

Online web-ide for ide.csound.com
https://ide.csound.com
GNU Lesser General Public License v2.1
30 stars 13 forks source link

unable to log in #371

Open OlaFosheimGrostad opened 2 years ago

OlaFosheimGrostad commented 2 years ago

When logging in I get "https://ide.csound.com/profile/undefined" and is redirected to "https://ide.csound.com/404".

hlolli commented 2 years ago

how are you logging in, with facebook/gmail/email?

vlazzarini commented 2 years ago

that's happening on my iphone with safari, I have not checked on the desktop. I'm logging in with my email.

Maybe the accounts server is down?

OlaFosheimGrostad commented 2 years ago

I used Chrome on Mac, I am logging in with my email.

vlazzarini commented 2 years ago

I can't login either from desktop on Chrome. I can load projects with links, and I can run them. Looks like the password server might be busted.

If I try to login with Facebook credentials, I get

Firebase: Invalid IdP response/credential: https://csound-ide.firebaseapp.com/__/auth/handler?error_code=1349126&error_message=App+not+set+up:+This+app+is+still+in+development+mode,+and+you+don't+have+access+to+it.+Switch+to+a+registered+test+user+or+ask+an+app+admin+for+permissions.&_=_ (auth/invalid-credential-or-provider-id).  [Dismiss](javascript:void(0))
vlazzarini commented 2 years ago

However, I can login with google and access a profile. With this, the link under "profile" does not go to "undefined". That may be the issue. Also, when trying to log in with my email, the profile photo does not appear.

hlolli commented 2 years ago

For me firefox and chrome work fine. But the bug lies in the password based login vs google oauth. I'm working on a fix (along with other regressions that came about).

hlolli commented 2 years ago

I am suspecting now that these are two different issues reported here.

The /profile/undefined I was able to reproduce when creating new account. There seems to be a bug with the profile completion step, for which I've pushed a fix hopefully fixing @OlaFosheimGrostad's issue.

As for the login mechanism failing, I'm unable to reproduce, I may suspect cache?

For the other comment, when logging in with email vs google, that the profile isn't visible. It's a use case that I didn't fully consider. I fear we are creating 2 different users when the same email is provided to email login or google oauth login. There's a way to unify identity with oauth, I need to look into that, to make that behavior automaitc. I fear at this stage, that it's better to stick with always google or always email.

vlazzarini commented 2 years ago

I tried to log in now from my phone into my email-based account. I could login, but my account avatar did not load and clicking on "profile" led me to the same 404 error.

I don't think it is to do with cache.

hlolli commented 2 years ago

@vlazzarini I see so it sounds like to me that the email-based account is a different user entity in our database and it doesn't have a username yet, which you pick after the account is created. That explains what I noticed, that /profile/undefined is a result of incompleted account creation process. A process which had a bug which I hoped to have changed yesterday. Try logging in and out in a desktop, and see if you get a modal window offering you to select username, bio, description etc.

vlazzarini commented 2 years ago

But I had an account for over two years. Does it mean it's lost?

hlolli commented 2 years ago

No absolutely not. Let me look deeper into this. I'm just theorizing that your main account is the one where you don't get /undefined, there's nothing disappeared?

vlazzarini commented 2 years ago

Ok, this looks like a Chrome-specific issue at least on the desktop. I can log in and go to my profile on Safari, while on Chrome, after logging in, my profile is still "undefined". I can go directly to my profile by passing the URL with my username. It takes a while for the page to be populated with my projects and at the corner, I still see a "login" button as if I had not logged in. If I click on a project, I can edit it.

Maybe it's cache after all?

vlazzarini commented 2 years ago

I cleared the cache and I still get the same results.

hlolli commented 2 years ago

ok thanks for your patience here @vlazzarini

my current theory is this is your profile https://ide.csound.com/profile/vlz ?

all good nothing's gone!

the part where I'm still trying to understand, is if firebase/google, know that the email/password account is one and the same account as google-oauth login. I'm theorizing that the way use go about logging forces you into certain profile, regardless of if the email used is the same for googel-oauth or email/password, that these are two different accounts. If not, it's still important for me to debug this, to know yes the browser and environment, but also, if this behavior is the same regardless of how you log in.

vlazzarini commented 2 years ago

yes, that's my profile and I can access it. But I can't login and go to it from Chrome.

If I use google OAUTH, I think I end up in a different profile, because the email is different.

I'm not concerned about my own account. What I'm worried is for other users who might get stuck (I have a class using the IDE).

hlolli commented 2 years ago

to narrow it down

Firefox/Safari: login with email works Chrome: login with email fails (undefined profile)

You nuked the cache, just for completion, when you try to login using "In-Cognito" that also fails the same way (in cognito is another nice way to rule out cache issues)?

hlolli commented 2 years ago

btw I'll try to do something about cache invalidation, I bet full class of students with cache issues isn't the most fun situation to be in.

hlolli commented 2 years ago

it seems index.html is not cached

> curl -I https://ide.csound.com                                                                                                                   openjdk
HTTP/2 200
cache-control: max-age=0,public,must-revalidate
content-type: text/html; charset=utf-8
etag: "2262ea5db773cc88278439fdb5c1052a19626dd186249bd4f7ae3819d975b70a"
last-modified: Mon, 18 Apr 2022 20:38:15 GMT
strict-transport-security: max-age=31556926
accept-ranges: bytes
date: Tue, 19 Apr 2022 18:38:41 GMT
x-served-by: cache-fra19136-FRA
x-cache: MISS
x-cache-hits: 0
x-timer: S1650393521.398741,VS0,VE76
vary: x-fh-requested-host, accept-encoding
content-length: 1194

but some assets like runtime-main.js is

2022-04-19 20 40 50

this could explain strange behavior, since we updated so many npm packages since last deployment

cc. @eddyc @kunstmusik

should be relatively easy to fix

vlazzarini commented 2 years ago

it's working on my phone both with Safari and Chrome now. I can't check on desktop at the moment but will try later.

vlazzarini commented 2 years ago

yes, I can confirm now that I can log in and go to my profile on Chrome. Whatever you've done seems to have fixed it, thanks.