File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/androidMain/kotlin/com/adamratzman/spotify/auth/pkce Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -86,10 +86,15 @@ public abstract class AbstractSpotifyPkceLoginActivity : AppCompatActivity() {
8686 super .onCreate(savedInstanceState)
8787 setContentView(R .layout.spotify_pkce_auth_layout)
8888
89- authorizationIntent = Intent (Intent .ACTION_VIEW , getAuthorizationUrl())
9089 credentialStore = application.getDefaultCredentialStore(clientId, redirectUri)
9190
92- startActivity(authorizationIntent)
91+ // This activity is recreated on every launch, therefore we need to make sure not to
92+ // launch the activity when a Spotify intent result has been received
93+ if (intent?.isSpotifyPkceAuthIntent(redirectUri) == false ) {
94+ authorizationIntent = Intent (Intent .ACTION_VIEW , getAuthorizationUrl())
95+ startActivity(authorizationIntent)
96+ finish()
97+ }
9398 }
9499
95100 /* *
You can’t perform that action at this time.
0 commit comments