fix(loadtest): verify через admin verification-token, убрать token из register. Refs EventHub/EventHubBack#30

This commit is contained in:
2026-07-15 00:12:32 +03:00
parent e8b90606c3
commit 6bba96c36e
6 changed files with 125 additions and 47 deletions
+7 -16
View File
@@ -78,23 +78,14 @@ register(Req) ->
% Создаём верификационный токен и отправляем письмо
{ok, VerificationToken, _Expires} = core_verification:create_token(User#user.id),
logic_email:send_verification_email(Email, VerificationToken),
BaseUser = #{
id => User#user.id,
email => User#user.email,
role => atom_to_binary(User#user.role, utf8),
status => atom_to_binary(User#user.status, utf8) % <<"pending">>
Response = #{
user => #{
id => User#user.id,
email => User#user.email,
role => atom_to_binary(User#user.role, utf8),
status => atom_to_binary(User#user.status, utf8) % <<"pending">>
}
},
%% На стендах (не prod) отдаём verification_token для loadtest/E2E
%% без доступа к почте (IFT EVENTHUB_ENV=stage).
Response = case os:getenv("EVENTHUB_ENV") of
"prod" ->
#{user => BaseUser};
_ ->
#{
user => BaseUser,
verification_token => VerificationToken
}
end,
handler_utils:send_json(Req1, 201, Response);
{error, email_exists} ->
handler_utils:send_error(Req1, 409, <<"Email already exists">>);