skillhub/server
wrj97 21456b9929
fix(auth): use SimpleUrlAuthenticationSuccessHandler for OAuth2 login (#266)
* fix(auth): use SimpleUrlAuthenticationSuccessHandler for OAuth2 login

Replace SavedRequestAwareAuthenticationSuccessHandler with
SimpleUrlAuthenticationSuccessHandler to prevent redirecting to
saved API requests after OAuth2 login.

Previously, when a user accessed a protected API endpoint (e.g.,
/api/web/skills) without authentication, Spring Security would save
that request. After OAuth2 login, the handler would redirect back to
the API endpoint instead of the dashboard.

Now the handler only uses:
- returnTo parameter from session (if present)
- default target URL (/dashboard) as fallback

* test(auth): add regression for OAuth2 success redirect; restore clearAuthenticationAttributes

Cover the no-returnTo + cached-API-request branch with HttpSessionRequestCache so
the original bug (post-login redirect resolving to /api/web/skills) cannot be
silently reintroduced. Also restore clearAuthenticationAttributes() in the
returnTo branch so it stays symmetric with the default branch (super clears it).

---------

Co-authored-by: xiose <huyanlin@nuaa.edu.cn>
2026-05-19 10:59:46 +08:00
..
.mvn docs: add Maven mirror config and troubleshooting guide for China developers (#233) 2026-04-07 09:50:07 +08:00
scripts feat(notification): add in-app notifications and harden delivery 2026-03-23 12:31:28 +08:00
skillhub-app fix(auth): close API token scope filter gap on /api/cli/ routes 2026-05-18 15:51:19 +08:00
skillhub-auth fix(auth): use SimpleUrlAuthenticationSuccessHandler for OAuth2 login (#266) 2026-05-19 10:59:46 +08:00
skillhub-domain fix(publish): address Codex review findings for dry-run 2026-05-18 14:50:14 +08:00
skillhub-infra fix(namespace): support team namespace deletion 2026-05-08 10:15:17 +08:00
skillhub-notification chore(notification): sync main and expand regression coverage 2026-03-23 15:04:47 +08:00
skillhub-search fix(search): restore clawhub namespace-only access 2026-04-21 17:28:05 +08:00
skillhub-storage fix(storage): disable chunked encoding for Aliyun OSS compatibility 2026-05-06 13:56:55 +08:00
.dockerignore feat(staging): optimize staging build with local Maven packaging 2026-03-14 14:21:06 +08:00
Dockerfile fix(storage): defer S3 bucket verification until first access (#289) 2026-04-12 15:24:09 +08:00
Dockerfile.dev fix(storage): defer S3 bucket verification until first access (#289) 2026-04-12 15:24:09 +08:00
mvnw feat: initialize Maven multi-module project structure 2026-03-11 22:52:04 +08:00
mvnw.cmd feat: initialize Maven multi-module project structure 2026-03-11 22:52:04 +08:00
pom.xml feat(notification): add in-app notifications and harden delivery 2026-03-23 12:31:28 +08:00