Skip to content

Upgrade anon accounts - #115

Merged
sidneywidmer merged 4 commits into
masterfrom
feature/account-upgrade
Jul 30, 2026
Merged

Upgrade anon accounts#115
sidneywidmer merged 4 commits into
masterfrom
feature/account-upgrade

Conversation

@sidneywidmer

@sidneywidmer sidneywidmer commented Jul 29, 2026

Copy link
Copy Markdown
Owner

If we're logged in with an Anon/Guest account we now have the simple option to upgrade to a "real" account.

image image image

This addition was necessary to play the "Tagestrump" in a later feature (#117) where we don't want Anon accoutns.

Guests can turn their profile into a real account from the signup form
(reachable from the settings sheet), keeping uuid, name and game history.

anonLink now reads the ory session from the ory_kratos_session cookie
instead of a request body, and clears the anon_token cookie on success so
AuthMiddleware stops preferring it. The .http files follow the same switch
from X-Session-Token to cookie auth.
@deepsource-io

deepsource-io Bot commented Jul 29, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 03eb626...d1c2f62 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Coverage  

Code Review Summary

Analyzer Status Updated (UTC) Details
Kotlin Jul 30, 2026 6:05p.m. Review ↗
Code coverage Jul 30, 2026 6:05p.m. Review ↗

Code Coverage Summary

Language Line Coverage (New Code) Line Coverage (Overall)
Aggregate
0%
69.9%
[▲ up 0.3% from master]
Kotlin
0%
69.9%
[▲ up 0.3% from master]

➟ Additional coverage metrics may have been reported. See full coverage report ↗


Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

- Restrict guest names to ascii so they stay valid for the ory identity
  schema, and let the upgrade form edit the prefilled name
- Keep the ory session cookie out of the logs, CanNotLinkAnonAccount now
  only carries the player uuid and answers 400 instead of 500
- Answer 409 when the ory identity already belongs to another player and
  tell the user to log in instead
- Require the expected origin on anon/link, both credentials are cookies
- Reset isAnon on logout
- Drop the origin check on /auth/anon/link, this gets solved globally later
- Allow german and french accents in usernames, in our validator and the
  kratos identity schema (both have to agree or an anon name blocks the upgrade)
- Rename guest to anon everywhere except in text exposed to the user
Removes the check itself plus everything that only existed for it: the
OryAccountAlreadyLinked error, its 409 mapping and the client side handling.

CanNotLinkAnonAccount loses its special 400 and falls through to the generic
500, so a failed link shows up in the error log.
@sidneywidmer
sidneywidmer force-pushed the feature/account-upgrade branch from a96fcde to d1c2f62 Compare July 30, 2026 18:05
@sidneywidmer
sidneywidmer merged commit e8f5847 into master Jul 30, 2026
3 of 4 checks passed
@sidneywidmer
sidneywidmer deleted the feature/account-upgrade branch July 30, 2026 18:06
sidneywidmer added a commit that referenced this pull request Jul 30, 2026
@sidneywidmer sidneywidmer mentioned this pull request Aug 5, 2026
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