mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-15 15:02:49 +01:00
Using a proper constant instead of val
Co-authored-by: KaiserBh <41852205+KaiserBh@users.noreply.github.com>
This commit is contained in:
parent
1993928bab
commit
569db9eac8
@ -152,7 +152,9 @@ class GoogleDriveSyncService(context: Context, json: Json, syncPreferences: Sync
|
|||||||
|
|
||||||
class GoogleDriveService(private val context: Context) {
|
class GoogleDriveService(private val context: Context) {
|
||||||
var googleDriveService: Drive? = null
|
var googleDriveService: Drive? = null
|
||||||
private val redirectUri = "eu.kanade.google.oauth:/oauth2redirect"
|
companion object {
|
||||||
|
const val REDIRECT_URI = "eu.kanade.google.oauth:/oauth2redirect"
|
||||||
|
}
|
||||||
private val syncPreferences = Injekt.get<SyncPreferences>()
|
private val syncPreferences = Injekt.get<SyncPreferences>()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@ -210,7 +212,7 @@ class GoogleDriveService(private val context: Context) {
|
|||||||
).setAccessType("offline").build()
|
).setAccessType("offline").build()
|
||||||
|
|
||||||
return flow.newAuthorizationUrl()
|
return flow.newAuthorizationUrl()
|
||||||
.setRedirectUri(redirectUri)
|
.setRedirectUri(REDIRECT_URI)
|
||||||
.setApprovalPrompt("force")
|
.setApprovalPrompt("force")
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
@ -313,7 +315,7 @@ class GoogleDriveService(private val context: Context) {
|
|||||||
secrets.installed.clientId,
|
secrets.installed.clientId,
|
||||||
secrets.installed.clientSecret,
|
secrets.installed.clientSecret,
|
||||||
authorizationCode,
|
authorizationCode,
|
||||||
redirectUri,
|
REDIRECT_URI,
|
||||||
).setGrantType("authorization_code").execute()
|
).setGrantType("authorization_code").execute()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user