Skip to content

Commit

Permalink
Merge pull request #43 from supertokens/fix-hardcoded-auth-mode
Browse files Browse the repository at this point in the history
fix: Fix hardcoded auth mode
  • Loading branch information
rishabhpoddar authored Sep 15, 2023
2 parents aba2f12 + 717db0a commit 7491f4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.2.8] - 2023-09-13

- Adds 1.18 to the list of supported FDI versions
- Fixes an issue where requests to the refresh endpoint would always send auth mode as cookies in the headers for http

## [0.2.7] - 2023-07-31

Expand Down
4 changes: 3 additions & 1 deletion lib/src/supertokens-http-client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ class Client extends http.BaseClient {
String? newCookiesToAdd =
await Client.cookieStore?.getCookieHeaderStringForRequest(refreshUrl);
refreshReq.headers[HttpHeaders.cookieHeader] = newCookiesToAdd ?? "";
refreshReq.headers.addAll({'st-auth-mode': 'cookie'});
SuperTokensTokenTransferMethod tokenTransferMethod =
SuperTokens.config.tokenTransferMethod;
refreshReq.headers.addAll({'st-auth-mode': tokenTransferMethod.getValue()});
refreshReq =
SuperTokens.config.preAPIHook(APIAction.REFRESH_TOKEN, refreshReq);
var resp = await refreshReq.send();
Expand Down

0 comments on commit 7491f4a

Please sign in to comment.