Skip to content

Commit

Permalink
feat(user): upgrade supertokens node to 13.6.0 (#419)
Browse files Browse the repository at this point in the history
* chore(deps): update supertokens-node package to 13.6.0

* feat(user): set default token transfer method to cookie
  • Loading branch information
rameshlohala committed Jun 27, 2023
1 parent dd9708d commit c91034a
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 122 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers = false
4 changes: 2 additions & 2 deletions packages/multi-tenant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"mercurius": "12.2.0",
"prettier": "2.8.8",
"slonik": "33.1.4",
"supertokens-node": "12.1.6",
"supertokens-node": "13.6.0",
"tsconfig": "0.32.10",
"typescript": "4.9.5",
"vite": "4.3.9",
Expand All @@ -74,7 +74,7 @@
"fastify-plugin": ">=4.3.0",
"mercurius": ">=12.2.0",
"slonik": ">=33.1.4",
"supertokens-node": ">=12.1.6",
"supertokens-node": ">=13.6.0",
"zod": ">=3.21.4"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/user/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"mercurius-auth": "4.0.0",
"prettier": "2.8.8",
"slonik": "33.1.4",
"supertokens-node": "12.1.6",
"supertokens-node": "13.6.0",
"tsconfig": "0.32.10",
"typescript": "4.9.5",
"vite": "4.3.9",
Expand All @@ -74,7 +74,7 @@
"mercurius": ">=12.2.0",
"mercurius-auth": ">=4.0.0",
"slonik": ">=33.1.4",
"supertokens-node": ">=12.1.4"
"supertokens-node": ">=13.6.0"
},
"engines": {
"node": ">=16",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import type { TypeInput as SessionRecipeConfig } from "supertokens-node/recipe/session/types";

const getSessionRecipeConfig = (): SessionRecipeConfig => {
return {};
return {
getTokenTransferMethod: (input) => {
return input.req.getHeaderValue("st-auth-mode") === "header"
? "header"
: "cookie";
},
};
};

export default getSessionRecipeConfig;

0 comments on commit c91034a

Please sign in to comment.