File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
android/src/main/java/com/codetrixstudio/capacitor/GoogleAuth Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public class GoogleAuth extends Plugin {
2727 @ Override
2828 public void load () {
2929 String clientId = this .getContext ().getString (R .string .server_client_id );
30- Boolean forceCodeForRefreshToken = false ;
30+ boolean forceCodeForRefreshToken = false ;
3131
3232 Boolean forceRefreshToken = (Boolean ) getConfigValue ("forceCodeForRefreshToken" );
3333 if (forceRefreshToken != null ) {
@@ -36,9 +36,12 @@ public void load() {
3636
3737 GoogleSignInOptions .Builder googleSignInBuilder = new GoogleSignInOptions .Builder (GoogleSignInOptions .DEFAULT_SIGN_IN )
3838 .requestIdToken (clientId )
39- .requestServerAuthCode (clientId , forceCodeForRefreshToken )
4039 .requestEmail ();
4140
41+ if (forceCodeForRefreshToken ) {
42+ googleSignInBuilder .requestServerAuthCode (clientId , true );
43+ }
44+
4245 try {
4346 JSONArray scopeArray = (JSONArray ) getConfigValue ("scopes" );
4447 Scope [] scopes = new Scope [scopeArray .length () - 1 ];
You can’t perform that action at this time.
0 commit comments