-
Notifications
You must be signed in to change notification settings - Fork 259
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
refactor(oidc): allow passing a Prompt
to get an OIDC url
#4131
refactor(oidc): allow passing a Prompt
to get an OIDC url
#4131
Conversation
3294bd0
to
2386ff2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! 👏
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4131 +/- ##
==========================================
- Coverage 84.72% 84.62% -0.11%
==========================================
Files 269 269
Lines 28837 28831 -6
==========================================
- Hits 24432 24398 -34
- Misses 4405 4433 +28 ☔ View full report in Codecov by Sentry. |
Changelog: `Client::url_for_oidc_login` is now `Client::url_for_oidc` with an additional `OidcPrompt` parameter. `abort_oidc_login` has been renamed to `abort_oidc_auth`. This allows clients to directly open the web page they want: the login one, the registration one, consent, etc. It should improve the UX in the registration flow since we can now skip the login one.
1959558
to
a83a630
Compare
Unknown { value: String }, | ||
} | ||
|
||
impl From<OidcPrompt> for SdkOidcPrompt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider annotating the SdkOidcPrompt
with the uniffi derive in place of adding the wrapper, since the wrapper seems completely equivalent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prompt
comes from an external crate, so I think there's no way to export it? Also, the enum uses the Case(value)
form, which is not allowed by uniffi 🫤 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i see, so SdkOidcPrompt
is a preexisting dubious name, but oh well. Nevermind me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true the name makes you think the type comes from the SDK... I can rename it to something better in another PR, but nothing came to mind. OAuth2OidcPrompt
? Should I just use the full oauth2types::requests::Prompt
form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not fret too much about it, sorry, this was more a light remark at the existing code. But yeah using the fully-qualified type would look great here!
This allows clients to directly open the web page they want: the login one, the registration one, consent, etc. It should improve the UX in the registration flow since we can now skip the login one.
Requested in element-hq/element-x-android#3635.
Signed-off-by: