Skip to content

Commit

Permalink
Avoid losing timezone from expiresAt field
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon committed Jul 16, 2024
1 parent 18ed011 commit 26180f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class LoginApiRequestHandler : ApiRequestHandler {
override fun onSuccess(credentials: Credentials) {
val scope = credentials.scope?.split(" ") ?: listOf()
val sdf =
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US)
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US)

val formattedDate = sdf.format(credentials.expiresAt)
result.success(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RenewApiRequestHandler : ApiRequestHandler {
override fun onSuccess(credentials: Credentials) {
val scope = credentials.scope?.split(" ") ?: listOf()
val sdf =
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US)
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US)

val formattedDate = sdf.format(credentials.expiresAt)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class GetCredentialsRequestHandler : CredentialsManagerRequestHandler {
override fun onSuccess(credentials: Credentials) {
val scopes = credentials.scope?.split(" ") ?: listOf()
val sdf =
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US)
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US)

val formattedDate = sdf.format(credentials.expiresAt)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class LoginWebAuthRequestHandler(private val builderResolver: (MethodCallRequest
// Success! Access token and ID token are presents
val scopes = credentials.scope?.split(" ") ?: listOf()
val sdf =
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US)
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US)

val formattedDate = sdf.format(credentials.expiresAt)

Expand Down

0 comments on commit 26180f8

Please sign in to comment.