File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
mobile/src/main/java/io/syslogic/github/network Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -43,18 +43,16 @@ public class TokenHelper {
43
43
@ Nullable
44
44
public static String getAccessToken (@ NonNull Context context ) {
45
45
AccountManager accountManager = AccountManager .get (context );
46
- if (mDebug ) {
47
- /* Attempting to load the personal access token from package meta. */
46
+ Account account = getAccount (accountManager , 0 );
47
+ if (account != null ) {
48
+ /* Default: Load the access token from AccountManager. */
49
+ return accountManager .getUserData (account , "token" );
50
+ } else if (mDebug ) {
51
+ /* Debug: Try to load and validate the access token. */
48
52
return loadTokenFromPackageMeta (context , accountManager );
49
53
} else {
50
- /* Attempting to load the personal access token from AccountManager. */
51
- Account account = getAccount (accountManager , 0 );
52
- if (account != null ) {
53
- return accountManager .getUserData (account , "token" );
54
- } else {
55
- Log .e (LOG_TAG , "account not found: " + Constants .ACCOUNT_TYPE );
56
- return null ;
57
- }
54
+ Log .e (LOG_TAG , "Account not found: " + Constants .ACCOUNT_TYPE );
55
+ return null ;
58
56
}
59
57
}
60
58
You can’t perform that action at this time.
0 commit comments