chirpy_server/sql/queries/user_from_token.sql

5 lines
181 B
MySQL
Raw Normal View History

2024-10-25 23:31:57 +02:00
-- name: GetUserFromRefreshToken :one
SELECT user_id FROM refresh_tokens
WHERE refresh_tokens.token = $1
AND refresh_tokens.expires_at > NOW()
AND refresh_tokens.revoked_at IS NULL;