feat(loadtest): IFT Tsung smoke/mix + verification_token на стендах. Refs EventHub/EventHubBack#30
This commit is contained in:
@@ -78,14 +78,23 @@ register(Req) ->
|
||||
% Создаём верификационный токен и отправляем письмо
|
||||
{ok, VerificationToken, _Expires} = core_verification:create_token(User#user.id),
|
||||
logic_email:send_verification_email(Email, VerificationToken),
|
||||
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">>
|
||||
}
|
||||
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">>
|
||||
},
|
||||
%% На стендах (не 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">>);
|
||||
|
||||
Reference in New Issue
Block a user