Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix missing refresh_token_hmac_key in models.Session 🐛 Issue Reference#2276

Open
Adityakk9031 wants to merge 1 commit intosupabase:master from
Adityakk9031:#2270
Open

Fix missing refresh_token_hmac_key in models.Session 🐛 Issue Reference #2276
Adityakk9031 wants to merge 1 commit intosupabase:master from
Adityakk9031:#2270

Conversation

@Adityakk9031
Copy link

@Adityakk9031 Adityakk9031 commented Dec 1, 2025

🐛 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

depthfirst-app[bot] reacted with thumbs up emoji
@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?

Copy link
Author

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

Comments

AltStyle によって変換されたページ (->オリジナル) /