Commit 95b4b91
authored
chore(auth): Refresh Token Rotation Test Fix (#4055)
* removed usage of old refresh token, updated test case to properly check for invalidTokens error in case the API returns a null token
* updated authfetchsigninsession tests to use GetTokenFromRefreshToken in mock clients
* updated further tests to use new API as well as auth hub event handler tests
* updated RefreshUserPoolTokens to use GetTokensFromRefreshToken API to enable refresh token rotation, also updated test mock clients and added unit tests
* removed refreshAuth function from initiateAuthInput
* reintroduced ternary operator to fallback to previous token if a null token is returned
* fixed ternary operator location
* removed unnecessary test since we don't set tokens to nil anymore1 parent 91de03a commit 95b4b91
File tree
2 files changed
+2
-40
lines changed- AmplifyPlugins/Auth
- Sources/AWSCognitoAuthPlugin/Actions/RefreshAuthorizationSession/UserPool
- Tests/AWSCognitoAuthPluginUnitTests/ActionTests/FetchAuthSession/FetchUserPoolTokens
2 files changed
+2
-40
lines changedLines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
77 | | - | |
| 76 | + | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
| |||
Lines changed: 0 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | 188 | | |
226 | 189 | | |
227 | 190 | | |
| |||
0 commit comments