mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-02-10 06:08:27 -06:00
8 lines
214 B
SQL
8 lines
214 B
SQL
-- name: AuthServiceGetUserByToken :one
|
|
SELECT
|
|
users.*,
|
|
sessions.id as session_id
|
|
FROM sessions
|
|
JOIN users ON users.id = sessions.user_id
|
|
WHERE pgp_sym_decrypt(sessions.token::bytea, @encryption_key) = @token;
|