mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2024-11-14 03:46:46 +01:00
Mohamed Sohail
77f127e14a
* feat: add admin/auth api - jwt cookie based auth - /auth - admin/* * add: meta proxy * fix: remove ussd account status from syncer * add: cookie defaults and nuxt init check route * add: pin and address handlers
18 lines
514 B
SQL
18 lines
514 B
SQL
-- name: get-password-hash
|
|
SELECT password_hash FROM staff WHERE username = $1;
|
|
|
|
-- name: pin-status
|
|
SELECT phone_number, failed_pin_attempts,
|
|
CASE STATUS
|
|
WHEN 1 THEN 'PENDING'
|
|
WHEN 2 THEN 'ACTIVE'
|
|
WHEN 3 THEN 'LOCKED'
|
|
WHEN 4 THEN 'RESET' END AS account_status
|
|
FROM cic_ussd.account WHERE
|
|
failed_pin_attempts > 0 OR STATUS = 4;
|
|
|
|
--name: phone-2-address
|
|
SELECT blockchain_address FROM users WHERE phone_number = $1;
|
|
|
|
--name: address-2-phone
|
|
SELECT phone_number FROM users WHERE blockchain_address = $1; |