Remove debug helper for OTP

This commit is contained in:
xbgmsharp
2023-01-28 21:28:02 +01:00
parent 69c8ec17f9
commit d419a582b9

View File

@@ -140,8 +140,12 @@ AS $email_validation$
-- Verify token -- Verify token
SELECT auth.verify_otp_fn(token) INTO _email; SELECT auth.verify_otp_fn(token) INTO _email;
IF _email IS NOT NULL THEN IF _email IS NOT NULL THEN
-- Check the email JWT token match the OTP email
IF current_setting('user.email', true) <> _email THEN
RETURN False;
END IF;
-- Set user email into env to allow RLS update -- Set user email into env to allow RLS update
PERFORM set_config('user.email', _email, false); --PERFORM set_config('user.email', _email, false);
-- Enable email_validation into user preferences -- Enable email_validation into user preferences
PERFORM api.update_user_preferences_fn('{email_valid}'::TEXT, True::TEXT); PERFORM api.update_user_preferences_fn('{email_valid}'::TEXT, True::TEXT);
-- Enable email_notifications -- Enable email_notifications