fix(backend): adapt CAUC login to current skin site flow - #47
Merged
Conversation
The skin site (skin.cauc.fun) serves the CAUC login form at /auth/cauc/login with cauc_username/cauc_password fields, not /auth/eduroam/login. Also, accounts on the site are keyed by <studentId>@cauc.edu.cn, so the yggdrasil authenticate call must use that email as the username — plain student id or player name is rejected with Invalid credential information. - Point the form login at /auth/cauc/login with the correct field names and treat a redirect away from /user as a failed login (wrong credentials). - Prefer <studentId>@cauc.edu.cn in the authenticate candidate usernames and store it as the account name so relogin works too. - Skip the empty nickname placeholder when scraping the player name from /user.
The skin site's CAUC login flows through /auth/cauc/login and validates against the CAUC OA service, not eduroam. The "eduroam" naming was a leftover from an earlier incorrect implementation, so rename the backend helper, the Tauri command (cauc_eduroam_login -> cauc_login) and the frontend service method (caucEduroamLogin -> caucLogin) to match the actual flow.
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.
Checklist
This PR is a ..
Related Issues
No related issue — the CAUC login button in the accounts page stopped working.
Description
The CAUC login button stopped working because the skin site (skin.cauc.fun) changed its login flow. Aligned the launcher with the site's
auth-caucplugin flow:/auth/cauc/login(not/auth/eduroam/login) withcauc_username/cauc_passwordfields, and a redirect away from/useris treated as a failed login (wrong credentials).<studentId>@cauc.edu.cn, so the yggdrasilauthenticatecall must use that email as the username — plain student id or player name is rejected withInvalid credential information. The email is also stored as the account name so relogin works./user.eduroamidentifiers (eduroam_login→cauc_login,cauc_eduroam_login→cauc_login,caucEduroamLogin→caucLogin) to match the actual flow.Additional Context
Verified end-to-end against the live site with a test account: form login obtains a session, then yggdrasil authenticate with
<studentId>@cauc.edu.cnreturns an access token and the selected profile.Checks:
cargo check✓ ·rustfmt --check✓ ·npx tsc --noEmit✓ · ESLint ✓ ·npm run locale diff en✓ (all 5 locales)