Skip to content

Conversation

@Adityakk9031
Copy link

πŸ› 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_key field to the models.Session struct with the correct db:"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:

500: missing destination name refresh_token_hmac_key in *models.Session

Adding this field ensures the database scanner can correctly bind the column, resolving refresh session failures in Swift and other clients.

βœ… Changes Included

  • Added RefreshTokenHmacKey *string \db:"refresh_token_hmac_key"``tomodels.Session.
  • Ensured struct now matches the schema of auth.sessions table.

πŸ” Root Cause

The auth.sessions table includes a column named refresh_token_hmac_key.
However, models.Session did not include the corresponding field, resulting in a mismatched struct during DB row scan and triggering the scanning error.

πŸ§ͺ Testing

  • Verified no duplicate Session structs exist using git grep.
  • Confirmed that scanning a row from auth.sessions into the updated struct completes without errors.
  • Manual test: refreshed session after 1 hour; no 500 errors observed.

πŸ“¦ Deployment Notes

  • Requires rebuild and redeploy of Supabase Auth service.
  • After deployment, session refresh via /token endpoint functions normally.

πŸ“„ Checklist

@Adityakk9031 Adityakk9031 requested a review from a team as a code owner December 1, 2025 10:59
@hf
Copy link
Contributor

hf commented Dec 1, 2025

Hmm this shouldn't be happening... do you mind sending a support ticket to view your project more closely?

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.

2 participants