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

[Request] Skip Auth.js sign-in page on SSO login if there is only one provider #1913

Closed
yanghanlin opened this issue Apr 6, 2024 · 6 comments · Fixed by #3400
Closed

[Request] Skip Auth.js sign-in page on SSO login if there is only one provider #1913

yanghanlin opened this issue Apr 6, 2024 · 6 comments · Fixed by #3400
Labels
🌠 Feature Request New feature or request | 特性与建议 Inactive No response in 30 days | 超过 30 天未活跃 released

Comments

@yanghanlin
Copy link
Contributor

yanghanlin commented Apr 6, 2024

🥰 Feature Description

Currently, LobeChat sends the user to the sign-in page provided by Auth.js (e.g. the screenshot below) to select the provider to continue.

Screenshot

However, as LobeChat does not support email or credentials provider for now, if there's only one SSO provider configured, it does not make much sense to display a button for the user only to click again. I think it can be better to skip this page and redirect the user directly to the SSO provider if there is only one to choose from.

🧐 Proposed Solution

According to the docs, ID of the selected provider can be provided to calls to signIn() to skip the sign-in page and redirect to the OAuth2 provider directly.

I'll be happy to submit a PR if we can make this change.

📝 Additional Information

No response

@yanghanlin yanghanlin added the 🌠 Feature Request New feature or request | 特性与建议 label Apr 6, 2024
@lobehubbot
Copy link
Member

👀 @yanghanlin

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@arvinxx
Copy link
Contributor

arvinxx commented Apr 6, 2024

I think it's better to skip choose If there's only one provider. But the implement method need to be think.
Currently I prefer to get the enable provider with /api/config. And then add a new selector to pick the state. If the length of enabled provider = 1, than set it into Signin function.

@yanghanlin
Copy link
Contributor Author

I think it's better to skip choose If there's only one provider. But the implement method need to be think. Currently I prefer to get the enable provider with /api/config. And then add a new selector to pick the state. If the length of enabled provider = 1, than set it into Signin function.

@arvinxx Thanks. Will try to implement.

@cy948
Copy link
Contributor

cy948 commented Apr 7, 2024

This change will require significant modifications to existing code and may introduce new rules for using login hooks. Please carefully consider the significance of this change and if necessary, please also change documentation for sso development in the PR.

@lobehubbot lobehubbot added the Inactive No response in 30 days | 超过 30 天未活跃 label Jun 7, 2024
@lobehubbot
Copy link
Member

@yanghanlin

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌠 Feature Request New feature or request | 特性与建议 Inactive No response in 30 days | 超过 30 天未活跃 released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants