-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use milliseconds for expiry time
- Loading branch information
1 parent
5bdf03a
commit 5c6227b
Showing
5 changed files
with
49 additions
and
21 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
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
19 changes: 19 additions & 0 deletions
19
auth/src/main/java/org/openedx/auth/domain/model/AuthResponse.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,19 @@ | ||
package org.openedx.auth.domain.model | ||
|
||
import android.os.Parcelable | ||
import kotlinx.parcelize.Parcelize | ||
import org.openedx.core.utils.TimeUtils | ||
|
||
@Parcelize | ||
data class AuthResponse( | ||
var accessToken: String?, | ||
var tokenType: String?, | ||
var expiresIn: Long?, | ||
var scope: String?, | ||
var error: String?, | ||
var refreshToken: String?, | ||
) : Parcelable { | ||
fun getTokenExpiryTime(): Long { | ||
return (expiresIn ?: 0L) + TimeUtils.getCurrentTime() | ||
} | ||
} |
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