mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:53:00 +03:00
[PR #379] [MERGED] fix: hash the refresh token in the DB (security) #847
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/379
Author: @ItalyPaleAle
Created: 3/23/2025
Status: ✅ Merged
Merged: 3/25/2025
Merged by: @stonith404
Base:
main← Head:refresh-token-hash📝 Commits (3)
83c3785fix: hash the refresh token in the DB3756c98Fix test0c3df58Use hex everywhere for consistency📊 Changes
2 files changed (+107 additions, -91 deletions)
View changed files
📝
backend/internal/service/oidc_service.go(+106 -90)📝
backend/internal/service/test_service.go(+1 -1)📄 Description
Fixup from #325
Makes sure that refresh tokens are stored as hashes in the database for security, as they are comparable to passwords.
Since refresh tokens are random strings of 40 characters (alphanumeric), they have enough entropy and a short-enough lifespan that a simple SHA-256 hash should suffice.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.