-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Settings attempts to login without credentials #6928
Comments
WIP on refactoring at I think these changes fix most things. The only pending issue (also on our main branch) is that logout doesn't properly reset/invalidate the stored credentials. |
@hawkrives I've spent some time looking at this and I think I've pinpointed where the issue is coming from. # source/lib/login.ts
async function loadCredentials(): Promise<SharedWebCredentials> {
let credentials = await getInternetCredentials(SIS_LOGIN_KEY)
- if (credentials === false) {
- throw new NoCredentialsError()
- }
return credentials
}
If useCredentials --> useQuery --> loadCredentials --> throws It wouldn't get the new values. Ever. Right? So things are invalidated, which is why we get the new correct UI after dismissing settings
Ideas around fixing this- async function loadCredentials(): Promise<SharedWebCredentials> {
+ async function loadCredentials(): Promise<false|SharedWebCredentials> {
let credentials = await getInternetCredentials(SIS_LOGIN_KEY)
- if (credentials === false) {
- throw new NoCredentialsError()
- }
return credentials
}
export async function performLogin(
credentials: Credentials | null = null,
): Promise<Credentials> {
+ const saved = credentials ?? (await loadCredentials())
+ if (!saved) {
+ throw new NoCredentialsError()
+ }
+ const {username, password} = saved
...
} Now the challenge is to convince ...after an out of band conversation with Hawken, it looks like the magic is within the
Nice! Looks like your suggestion works to change where our types are now expecting false! -type QueryFnData = SharedWebCredentials
+type QueryFnData = SharedWebCredentials|false |
Is this a regression from #6899?
Upload.from.GitHub.for.iOS.MOV
The text was updated successfully, but these errors were encountered: