Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide information how to reset passphrase on mismatch #355

Merged
merged 1 commit into from Mar 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/mix/tasks/hex.ex
Expand Up @@ -144,7 +144,9 @@ defmodule Mix.Tasks.Hex do
{:ok, key} ->
key
:error ->
Mix.raise "Wrong passphrase"
Mix.raise "Wrong passphrase\n\n" <>
"If you forgot your passphrase, you can reset it using `mix hex.user reset password`" <>
" or on the hex website: https://hex.pm/password/reset"
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/mix/tasks/hex/user_test.exs
Expand Up @@ -84,7 +84,7 @@ defmodule Mix.Tasks.Hex.UserTest do
config = Hex.Config.read
assert config[:encrypted_key]

assert_raise Mix.Error, "Wrong passphrase", fn ->
assert_raise Mix.Error, ~r"^Wrong passphrase", fn ->
send self(), {:mix_shell_input, :prompt, "wrong"}
Mix.Tasks.Hex.User.run(["passphrase"])
end
Expand Down