1
Refresh token length should be configurable (currently hardcoded to 12)
Source: supabase/supabase#45555 · opened by @opxdelwin
Current behavior
Refresh tokens are hardcoded to 12 alphanumeric characters in [internal/models/refresh_token.go](
Problem
12 characters is a short token for a credential that can live for days or weeks. While token rotation mitigates some risk, a stolen token within its reuse interval is still exploitable — and a longer token raises the bar meaningfully.
This also causes friction with client-side validation in some SDKs and native apps that expect tokens of a more typical length (e.g. 32+ chars).
Suggested fix
Either:
• Increase the hardcoded length to 32 (one-line change, no breaking changes), or
• Expose it as a configurable env var (e.g. GOTRUE_REFRESH_TOKEN_LENGTH)
References
• Community discussion:
Refresh tokens are hardcoded to 12 alphanumeric characters in [internal/models/refresh_token.go](
Problem
12 characters is a short token for a credential that can live for days or weeks. While token rotation mitigates some risk, a stolen token within its reuse interval is still exploitable — and a longer token raises the bar meaningfully.
This also causes friction with client-side validation in some SDKs and native apps that expect tokens of a more typical length (e.g. 32+ chars).
Suggested fix
Either:
• Increase the hardcoded length to 32 (one-line change, no breaking changes), or
• Expose it as a configurable env var (e.g. GOTRUE_REFRESH_TOKEN_LENGTH)
References
• Community discussion:
No pledges yet. Be the first to back this.
Comments
Similar requests
Automatically Logout users in cases when persistSession is false and the user closes the browser window
1 vote · 0 comments
[Auth] Allow indefinite refresh token reuse
5 votes · 0 comments
[Auth] Display user valid sessions and allow to invalidate some or all of them
14 votes · 0 comments
Why do I need to do manual refresh of the realtime token?
1 vote · 0 comments
Forcefully create a managed user session.
1 vote · 0 comments
No comments yet.