Skip to content
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

SOLID: A cancel on authentication to be graciously handled #38

Closed
gjwgit opened this issue Jan 6, 2024 · 2 comments
Closed

SOLID: A cancel on authentication to be graciously handled #38

gjwgit opened this issue Jan 6, 2024 · 2 comments
Assignees

Comments

@gjwgit
Copy link
Contributor

gjwgit commented Jan 6, 2024

Description

When on the Authenticate screen in the browser:

Image

I click cancel and the app is blocked with an exception:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0      TokenResponse.idToken (package:solid_auth/src/openid/src/model/token_response.dart:25:66)
#1      Credential.generateLogoutUrl (package:solid_auth/src/openid/src/openid.dart:231:31)
#2      authenticate (package:solid_auth/solid_auth_client.dart:220:35)
<asynchronous suspension>
#3      solidAuthenticate (package:solid/src/solid/authenticate.dart:78:22)
<asynchronous suspension>
#4      _SolidLoginState.build.<anonymous closure> (package:solid/src/solid/login.dart:212:28)
<asynchronous suspension>

It seems the code to capture this is not doing so.

@gjwgit
Copy link
Contributor Author

gjwgit commented Jan 7, 2024

I had to replace on () with catch () for it to catch the above error.

I now get the popup but on clicking Ok it remains with the busy animation:

image

Need to terminate the animation and return to the login screen.

@gjwgit
Copy link
Contributor Author

gjwgit commented Jan 7, 2024

I have a solution of sorts - Replacing the failed auth popup with a navigate to the login app (the current widget).

Please review https://github.com/anusii/solid/tree/gjw/38_clean_failed_authenticate

@gjwgit gjwgit closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants