feat(auth): return user_id from verify-email - #8
Merged
Conversation
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.
Adds
user_idto the verify-email response so the portal can build a deep link back into the app.Why
After verifying an address the portal can only tell the user to go back to the app by hand, where they still have to click "I verified" to refresh the session. The client now handles
voltius://verified?u=<users.id>and refreshes itself — but only if the portal knows which user was verified.This is deliberately
users.idand notaccount_id:account_idis the client's KDF salt, and it must never leave the device.users.idauthorises nothing.What changed
VerifyEmailResponsegainsuser_id, and the existing CTE returnsusers.idalongside the email it already returned. No new endpoint, no new token, no change to the token's single-use semantics or to the 410-expired / 400-invalid discrimination below it.Verification
cargo checkclean. This crate has no test harness —server/tests/does not exist andauth.rshas nomod tests— socargo checkplus the client-side live run is the whole gate. A harness invented for one field would have been the wrong call.Companion PRs
verifiedhandlerShip this before the portal, or in either order — the portal gates its button on the field being present, so it degrades to today's card without it.