File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -24,30 +24,28 @@ class LoginCommand extends PubCommand {
24
24
@override
25
25
Future <void > runProtected () async {
26
26
final credentials = oauth2.loadCredentials ();
27
+ final userInfo = await _retrieveUserInfo ();
28
+
27
29
if (credentials == null ) {
28
- final userInfo = await _retrieveUserInfo ();
29
30
if (userInfo == null ) {
30
31
log.warning (
31
- 'Could not retrieve your user- details.\n '
32
- 'You might have to run `$topLevelProgram pub logout` '
33
- 'to delete your credentials and try again.' ,
32
+ 'Could not retrieve your user details.\n '
33
+ 'Run `$topLevelProgram pub logout` to delete credentials and try '
34
+ 'again.' ,
34
35
);
35
36
} else {
36
37
log.message ('You are now logged in as $userInfo ' );
37
38
}
38
39
} else {
39
- final userInfo = await _retrieveUserInfo ();
40
40
if (userInfo == null ) {
41
41
log.warning (
42
- 'Your credentials seems broken.\n '
43
- 'Run `$topLevelProgram pub logout` '
44
- 'to delete your credentials and try again.' ,
42
+ 'Your credentials seem to be broken.\n '
43
+ 'Run `$topLevelProgram pub logout` to delete credentials and try '
44
+ 'again.' ,
45
45
);
46
+ } else {
47
+ log.message ('You are already logged in as $userInfo ' );
46
48
}
47
- log.warning (
48
- 'You are already logged in as $userInfo \n '
49
- 'Run `$topLevelProgram pub logout` to log out and try again.' ,
50
- );
51
49
}
52
50
}
53
51
You can’t perform that action at this time.
0 commit comments