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

Plans for Dynamic clientId Updates? #60

Open
zuhno opened this issue Dec 30, 2023 · 10 comments
Open

Plans for Dynamic clientId Updates? #60

zuhno opened this issue Dec 30, 2023 · 10 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@zuhno
Copy link
Contributor

zuhno commented Dec 30, 2023

Hello :)

Is your feature request related to a problem? Please describe.
I'm currently facing a limitation with the static assignment of the clientId value. My backend server provides redirect_uri and clientId, which I wish to dynamically utilize in my application. However, the current implementation does not allow for changing the clientId symbol value after initialization, leading to inflexibility in adapting to different server responses.

Describe the solution you'd like
I would like the ability to dynamically update the clientId value. Specifically, the solution would involve:

  1. Using setClientId to change the clientId symbol value.
  2. Modifying useOneTap, useTokenClient, useCodeClient hooks to accept clientId as part of the options object, enabling the use of either the initialization value or the dynamically provided clientId.

To implement the above, it would be necessary to optionally accept clientId during app installation.

Describe alternatives you've considered
An alternative could be a more static configuration, but this lacks the flexibility required for different backend responses. I'm open to other suggestions that could provide similar functionality.

Additional context
The inability to dynamically update the clientId hinders the adaptability of the application to different backend environments. Also, there was an issue with the package.json version not being updated, causing a failure in GitHub Action and preventing the NPM version from updating. This is an additional context that might be relevant to the overall functionality and deployment process.

@kasvith
Copy link
Collaborator

kasvith commented Dec 31, 2023

Hi @zuhno this is a good suggestion, lets see what we can do here

im initially thinking of providing a method to update the client id value in the provider as you mentioned

@kasvith kasvith added the enhancement New feature or request label Dec 31, 2023
@zuhno
Copy link
Contributor Author

zuhno commented Dec 31, 2023

@kasvith
If we develop using the methods provided by the provider, it seems necessary to verify the initialization of the clientId in the hooks. Having the hooks receive the clientId as an options member would have the advantage of allowing each hook to use a different clientId, though I haven't thought about it in detail yet.

Would it be okay for me to work on it as you suggested and submit a pull request?

@kasvith
Copy link
Collaborator

kasvith commented Dec 31, 2023

sure, go ahead and do a PR, lets review it

@zuhno
Copy link
Contributor Author

zuhno commented Jan 2, 2024

Thanks @kasvith, Opened PR(#61). please review it.

@kasvith
Copy link
Collaborator

kasvith commented Apr 23, 2024

hi, will do. i got little busy

@splitwarechef
Copy link

Is this still in development? It would really be nice to have this feature

@kasvith
Copy link
Collaborator

kasvith commented Oct 30, 2024

hey guys sorry i was bit occupied with some work

i will get back to it, seems @zuhno 's PR is fine, few final checks and its good to go

im also planning on a re-write with vite 5 and upgrade support for nuxt

@kasvith
Copy link
Collaborator

kasvith commented Oct 30, 2024

hi @zuhno made few comments on PR, can you check

@zuhno
Copy link
Contributor Author

zuhno commented Oct 31, 2024

hi @kasvith
i've reviewed the comments left on the PR and added responses to them as well. once those responses are resolved, i'll proceed with the improvements right away. for nuxt support of this feature, it should be possible to add it after checking the flow.

@kasvith
Copy link
Collaborator

kasvith commented Oct 31, 2024

hi @zuhno replied you back

yes we can support this with nuxt also, im however planning to do some migration to latest vite and nuxt with FedCM, will update the main soon

@kasvith kasvith added this to the v3.0.0 milestone Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants