feat: create default personal calendar on email verification. Refs EventHub/EventHubBack#49
This commit is contained in:
@@ -19,7 +19,12 @@ init(Req, _Opts) ->
|
||||
{ok, UserId} ->
|
||||
core_user:update(UserId, [{status, active}]),
|
||||
core_verification:delete_token(Token),
|
||||
handler_utils:send_json(Req1, 200, #{<<"message">> => <<"Account verified">>});
|
||||
case logic_calendar:ensure_default_calendar(UserId) of
|
||||
ok ->
|
||||
handler_utils:send_json(Req1, 200, #{<<"message">> => <<"Account verified">>});
|
||||
{error, Reason} ->
|
||||
handler_utils:send_error(Req1, 500, Reason)
|
||||
end;
|
||||
{error, expired} ->
|
||||
handler_utils:send_error(Req1, 410, <<"Token expired">>);
|
||||
{error, not_found} ->
|
||||
|
||||
Reference in New Issue
Block a user