mirror of
https://github.com/1f349/lavender.git
synced 2025-01-21 06:06:30 +00:00
28 lines
449 B
SQL
28 lines
449 B
SQL
-- name: SetOtp :exec
|
|
UPDATE users
|
|
SET otp_secret = ?,
|
|
otp_digits=?
|
|
WHERE subject = ?;
|
|
|
|
-- name: DeleteOtp :exec
|
|
UPDATE users
|
|
SET otp_secret='',
|
|
otp_digits=0
|
|
WHERE subject = ?;
|
|
|
|
-- name: GetOtp :one
|
|
SELECT otp_secret, otp_digits
|
|
FROM users
|
|
WHERE subject = ?;
|
|
|
|
-- name: HasOtp :one
|
|
SELECT CAST(1 AS BOOLEAN) AS hasOtp
|
|
FROM users
|
|
WHERE subject = ?
|
|
AND otp_secret != '';
|
|
|
|
-- name: GetUserEmail :one
|
|
SELECT email
|
|
FROM users
|
|
WHERE subject = ?;
|