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() {
86
86
super .onCreate(savedInstanceState)
87
87
setContentView(R .layout.spotify_pkce_auth_layout)
88
88
89
- authorizationIntent = Intent (Intent .ACTION_VIEW , getAuthorizationUrl())
90
89
credentialStore = application.getDefaultCredentialStore(clientId, redirectUri)
91
90
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
+ }
93
98
}
94
99
95
100
/* *
You can’t perform that action at this time.
0 commit comments