Skip to content

fix(backend): adapt CAUC login to current skin site flow - #47

Merged
Origin173 merged 2 commits into
mainfrom
fix/cauc-login
Aug 16, 2026
Merged

fix(backend): adapt CAUC login to current skin site flow#47
Origin173 merged 2 commits into
mainfrom
fix/cauc-login

Conversation

@Origin173

Copy link
Copy Markdown
Owner

Checklist

  • Changes have been tested locally and work as expected.
  • All tests in workflows pass successfully.
  • Documentation has been updated if necessary.
  • Code formatting and commit messages align with the project's conventions.
  • Comments have been added for any complex logic or functionality if possible.

This PR is a ..

  • 🆕 New feature
  • 🐞 Bug fix
  • 🛠 Refactoring
  • ⚡️ Performance improvement
  • 🌐 Internationalization
  • 📄 Documentation improvement
  • 🎨 Code style optimization
  • ❓ Other (Please specify below)

Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • e.g. close #xxxx, fix #xxxx

No related issue — the CAUC login button in the accounts page stopped working.

Description

  • Please insert your description here and provide info about the "what" this PR is solving.

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-cauc plugin flow:

  • The CAUC login form lives at /auth/cauc/login (not /auth/eduroam/login) with cauc_username / cauc_password fields, and a redirect away from /user is treated as a failed login (wrong credentials).
  • 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. The email is also stored as the account name so relogin works.
  • Skip the empty nickname placeholder when scraping the player name from /user.
  • Renamed the leftover eduroam identifiers (eduroam_logincauc_login, cauc_eduroam_logincauc_login, caucEduroamLogincaucLogin) to match the actual flow.

Additional Context

  • Add any other relevant information or screenshots here.

Verified end-to-end against the live site with a test account: form login obtains a session, then yggdrasil authenticate with <studentId>@cauc.edu.cn returns an access token and the selected profile.

Checks: cargo check ✓ · rustfmt --check ✓ · npx tsc --noEmit ✓ · ESLint ✓ · npm run locale diff en ✓ (all 5 locales)

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.
@Origin173
Origin173 merged commit 9bccd6e into main Aug 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant