From 49bad13fe7c2bd3faa6b19366df23dd0097b163d Mon Sep 17 00:00:00 2001 From: xbgmsharp Date: Mon, 14 Aug 2023 17:54:20 +0200 Subject: [PATCH] Update api.recoveir, Enforce/Enable email_notifications --- initdb/02_5_signalk_auth_otp.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/initdb/02_5_signalk_auth_otp.sql b/initdb/02_5_signalk_auth_otp.sql index 42e06de..c893c48 100644 --- a/initdb/02_5_signalk_auth_otp.sql +++ b/initdb/02_5_signalk_auth_otp.sql @@ -99,6 +99,8 @@ AS $recover_fn$ -- Generate OTP otp_pass := api.generate_otp_fn(email); SELECT CONCAT('uuid=', _user_id, '&token=', otp_pass) INTO _reset_qs; + -- Enable email_notifications + PERFORM api.update_user_preferences_fn('{email_notifications}'::TEXT, True::TEXT); -- Send email/notifications user_settings := '{"email": "' || _email || '", "reset_qs": "' || _reset_qs || '"}'; PERFORM send_notification_fn('email_reset'::TEXT, user_settings::JSONB);