Fix missing refresh_token_hmac_key in models.Session π Issue Reference #2276
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.
π Issue Reference
Fixes supabase/auth issue #2270 β *"missing destination name refresh_token_hmac_key in models.Session" during session refresh on iOS (Swift SDK).
π Summary
This PR adds the missing
refresh_token_hmac_keyfield to themodels.Sessionstruct with the correctdb:"refresh_token_hmac_key"tag. The Supabase Auth server returns this column in queries, but the Go model previously lacked the corresponding destination field, causing scan errors:Adding this field ensures the database scanner can correctly bind the column, resolving refresh session failures in Swift and other clients.
β Changes Included
RefreshTokenHmacKey *string \db:"refresh_token_hmac_key"``tomodels.Session.auth.sessionstable.π Root Cause
The
auth.sessionstable includes a column namedrefresh_token_hmac_key.However,
models.Sessiondid not include the corresponding field, resulting in a mismatched struct during DB row scan and triggering the scanning error.π§ͺ Testing
Sessionstructs exist usinggit grep.auth.sessionsinto the updated struct completes without errors.π¦ Deployment Notes
π Checklist
models.Sessionwith correct database tag.