From 3065df331c2cf3e3570a290d572d96191e8849d7 Mon Sep 17 00:00:00 2001 From: Vitalii Parashchak Date: Mon, 23 Oct 2023 16:28:16 +0200 Subject: [PATCH] Ensure TIMESTAMP presents date-time in English locale format for SRP authentication (#45) --- .../Authenticatable+SRP+async.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/SotoCognitoAuthenticationSRP/Authenticatable+SRP+async.swift b/Sources/SotoCognitoAuthenticationSRP/Authenticatable+SRP+async.swift index b6e19b9..c9cc8c9 100644 --- a/Sources/SotoCognitoAuthenticationSRP/Authenticatable+SRP+async.swift +++ b/Sources/SotoCognitoAuthenticationSRP/Authenticatable+SRP+async.swift @@ -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_US_POSIX") let timestamp = dateFormatter.string(from: Date()) // construct claim