Repository navigation
feat(login): lead with embedded Feishu/WeCom QR sign-in - #113
Merged
Merged
Conversation
When a Feishu or WeCom login app is configured, the sign-in page now opens on that platform's QR code instead of the password form; username and password become a secondary link. With both configured a switch picks the platform and the choice is remembered. With neither, only the password form shows. - Feishu: POST /api/auth/feishu/qr returns a passport authorize URL; the page frames Feishu's QR page and, on the tmp_code it posts back (checked against the frame and a feishu.cn origin), navigates to goto&tmp_code. Feishu then returns to the existing callback with code/state. - WeCom: POST /api/auth/wecom/qr returns the ww.createWWLoginPanel params; the panel (@wecom/jssdk, lazy-loaded) hands back the code in callback mode and the page opens the existing callback with code/state. - Both QR endpoints share state creation with /start. A browser reuses its existing binding cookie so several login tabs (or the 9-minute QR refresh) no longer invalidate each other's state. - Inside the Feishu/WeCom client the page still auto-starts the in-app login and no longer renders the card meanwhile, so no QR request races that redirect for the binding cookie. - Platform icons are vendored from IconPark (Apache-2.0) and TDesign Icons (MIT) with a NOTICE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scan-to-sign-in is now the primary entry on the login page; username/password is secondary.
ww.createWWLoginPanel) embedded.How it works
POST /api/auth/feishu/qrreturns apassport.feishu.cnauthorize URL. The page frames Feishu's QR page (whatLarkSSOSDKWebQRCodedoes, without loading the third-party script), accepts thetmp_codemessage only from that frame and afeishu.cnorigin, then navigates togoto&tmp_code=…. Feishu redirects to the existing/api/auth/feishu/callbackwithcode/state.POST /api/auth/wecom/qrreturns the panel params;@wecom/jssdk(lazy-loaded chunk, ~18 KB gzip, only when WeCom is configured) runs incallbackmode and the page opens the existing/api/auth/wecom/callback./start. The QR is re-issued every 9 minutes (state TTL is 10).new-lark(Apache-2.0) and TDesignlogo-wecom-filled(MIT), recolored, with NOTICE and license files inweb/public/platforms/.Test plan
uv run ruff check .,uv run mypy coreman,uv run pytest(2988 passed)npm run lint,vue-tsc --noEmit,vitest run(318 passed),npm run build🤖 Generated with Claude Code