Skip to content

Commit

Permalink
Ensure TIMESTAMP presents date-time in English locale format for SRP …
Browse files Browse the repository at this point in the history
…authentication compatibility, regardless of phone's locale
  • Loading branch information
vparashchak committed Oct 19, 2023
1 parent f783467 commit db68973
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public extension CognitoAuthenticatable {
// cognito expects the dateformat to have the timezone as UTC
dateFormatter.dateFormat = "EEE MMM d HH:mm:ss 'UTC' yyyy"
dateFormatter.timeZone = TimeZone(identifier: "UTC")
// cognito expects the dateformat to be in English
dateFormatter.locale = Locale(identifier: "en")
let timestamp = dateFormatter.string(from: Date())

// construct claim
Expand Down

0 comments on commit db68973

Please sign in to comment.