File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 43
43
$password = $term -> get_reply(prompt => ' Hub Password' ); # TODO hide the input? O:)
44
44
}
45
45
46
- my $login = $ua -> post(' https://hub.docker.com/v2/users/login/' => {} => json => { username => $username , password => $password });
47
- die ' login failed' unless $login -> res-> is_success;
46
+ my $dockerHub = ' https://hub.docker.com' ;
47
+
48
+ my $login = $ua -> post($dockerHub . ' /v2/users/login/' => {} => json => { username => $username , password => $password });
49
+ die ' login failed: ' . $login -> res-> error-> {message } unless $login -> res-> is_success;
48
50
49
51
my $token = $login -> res-> json-> {token };
50
52
57
59
}
58
60
die ' missing CSRF token' unless defined $csrf ;
59
61
60
- my $attemptLogin = $ua -> post(' https://hub.docker.com /attempt-login/' => {} => json => { jwt => $token });
62
+ my $attemptLogin = $ua -> post($dockerHub . ' /attempt-login/' => {} => json => { jwt => $token });
61
63
die ' attempt-login failed' unless $attemptLogin -> res-> is_success;
62
64
63
65
my $authorizationHeader = {
@@ -171,7 +173,7 @@ sub prompt_for_edit {
171
173
my $repoName = $repo ;
172
174
$repoName =~ s ! ^.*/!! ; # 'hylang', 'perl', etc
173
175
174
- my $repoUrl = ' https://hub.docker.com /v2/repositories/' . $repo . ' /' ;
176
+ my $repoUrl = $dockerHub . ' /v2/repositories/' . $repo . ' /' ;
175
177
176
178
if ($logos && $repo =~ m { ^ library/ } x ) {
177
179
# the "library" org images include a logo which is displayed in the Hub UI
You can’t perform that action at this time.
0 commit comments