Open YangHanlin opened 3 months ago
👀 @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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
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.
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.
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.
🥰 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.
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