Сделано подтверждение регистрации пользователей #22

This commit is contained in:
2026-05-27 21:44:13 +03:00
parent b78df927dd
commit 4444461ee3
17 changed files with 358 additions and 48 deletions
+9 -5
View File
@@ -35,11 +35,15 @@ authenticate_user(Email, Password) ->
{ok, User} ->
case verify_password(Password, User#user.password_hash) of
{ok, true} ->
{ok, #{
id => User#user.id,
email => User#user.email,
role => atom_to_binary(User#user.role, utf8)
}};
case User#user.status of
pending -> {error, not_verified};
active -> {ok, #{
id => User#user.id,
email => User#user.email,
role => atom_to_binary(User#user.role, utf8)
}};
_ -> {error, invalid_credentials}
end;
_ -> {error, invalid_credentials}
end;
{error, not_found} -> {error, invalid_credentials}
+4
View File
@@ -0,0 +1,4 @@
-module(logic_email).
-export([send_verification_email/2]).
send_verification_email(Email, Token) ->
io:format("Sending verification email to ~s with token ~s~n", [Email, Token]).