-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
127 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
shared/src/commonMain/kotlin/co/nimblehq/blisskmmic/data/network/target/RefreshTokenType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package co.nimblehq.blisskmmic.data.network.target | ||
|
||
import co.nimblehq.blisskmmic.BuildKonfig | ||
import co.nimblehq.blisskmmic.data.network.helpers.TargetType | ||
import io.ktor.http.* | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
class RefreshTokenType(refreshToken: String): | ||
TargetType<RefreshTokenType.RefreshTokenInput> { | ||
|
||
@Serializable | ||
data class RefreshTokenInput( | ||
@SerialName("grant_type") val grantType: String, | ||
@SerialName("refresh_token") val refreshToken: String, | ||
@SerialName("client_id") val clientId: String, | ||
@SerialName("client_secret") val clientSecret: String | ||
) | ||
|
||
override val path = "oauth/token" | ||
override val method = HttpMethod.Post | ||
override val body = RefreshTokenInput( | ||
"refresh_token", | ||
refreshToken, | ||
BuildKonfig.CLIENT_ID, | ||
BuildKonfig.CLIENT_SECRET | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters