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

feat: handle auth flow natively #2869

Merged
merged 7 commits into from
Dec 6, 2023
Merged

feat: handle auth flow natively #2869

merged 7 commits into from
Dec 6, 2023

Conversation

pavanjoshi914
Copy link
Contributor

@pavanjoshi914 pavanjoshi914 commented Nov 16, 2023

Describe the changes you have made in this PR

one way we can eliminate identity api is to use completely native browser api so that we can support all the browsers including firefox for android

doesn't require any hacks or content script. just using tabs api and event listeners which works on all the browsers including android

@reneaaron reneaaron marked this pull request as draft November 16, 2023 14:36
@pavanjoshi914
Copy link
Contributor Author

pavanjoshi914 commented Nov 17, 2023

everything else is done only this is to create client. which requires a redirect url. not sure what to use as redirect url. new page in getalby.com?

@bumi
Copy link
Collaborator

bumi commented Nov 25, 2023

Is there a way we can append the amount of accounts the user has to the URL?

@pavanjoshi914
Copy link
Contributor Author

Is there a way we can append the amount of accounts the user has to the URL?

not sure about this. why we need that?

@bumi
Copy link
Collaborator

bumi commented Nov 25, 2023

Is there a way we can append the amount of accounts the user has to the URL?

not sure about this. why we need that?

There are those reports that people struggling with adding another account when they are logged in because we don't prompt them.
So I thought maybe we auto authorize the first call but not when the user has multiple accounts already.

@pavanjoshi914
Copy link
Contributor Author

we build auth url and add search-params in the following way in js-sdk

  url.search = buildQueryString({
      ...options,
      client_id,
      scope: scopes.join(" "),
      response_type: "code",
      redirect_uri: callback,
      code_challenge_method,
      code_challenge,
    });

I don't think we have any option to pass additional metadata such as a number of accounts. maybe we introduce such fields in options? or any separate field?

Copy link
Contributor

@reneaaron reneaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

Created a follow-up-issue for improving the account connection in multi-account scenarios:

#2909

@reneaaron reneaaron merged commit c393a3e into master Dec 6, 2023
6 of 7 checks passed
@reneaaron reneaaron deleted the native-auth-flow branch December 6, 2023 15:51
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

Successfully merging this pull request may close these issues.

4 participants