Skip to content

Commit

Permalink
resolved pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dPreininger committed Nov 11, 2023
1 parent d94197e commit 6774541
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 55 deletions.
4 changes: 2 additions & 2 deletions packages/medusa-plugin-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
"test:ci": "yarn add -D @medusajs/medusa@${MEDUSAJS_VERSION} && yarn run test"
},
"peerDependencies": {
"@medusajs/medusa": "<=1.16.x",
"@medusajs/medusa": ">=1.16.x",
"passport": "^0.6.0",
"typeorm": "*"
},
"devDependencies": {
"@medusajs/medusa": "^1.17.0",
"@medusajs/medusa": ">=1.17.x",
"@types/express": "^4.17.17",
"@types/jest": "^29.1.2",
"jest": "^29.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import { authenticateSessionFactory, signToken } from '../../core/auth-callback-

function firebaseCallbackMiddleware(domain: 'admin' | 'store', configModule: ConfigModule, expiresIn?: number) {
return (req: Request, res: Response) => {
console.log(req.query);
if(req.query.returnAccessToken == 'true') {
const token = signToken(domain, configModule, req.user, expiresIn);
res.json({ access_token: token });
return;
} else {
const authenticateSession = authenticateSessionFactory(domain);
authenticateSession(req, res);
authenticateSessionFactory(domain)(req, res);

res.status(200).json({ result: 'OK' });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ export function getLinkedinAdminAuthRouter(linkedin: LinkedinAuthOptions, config
passportCallbackAuthenticateMiddlewareOptions: {
failureRedirect: linkedin.admin.failureRedirect,
},
expiresIn: linkedin.store.expiresIn,
expiresIn: linkedin.admin.expiresIn,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ function successActionHandlerFactory(req: Request, domain: 'admin' | 'store', co
const returnAccessToken = req.query.returnAccessToken == 'true';
const redirectUrl = (req.query.redirectTo ? req.query.redirectTo : defaultRedirect) as string;

console.log(expiresIn);

if(returnAccessToken) {
return (req: Request, res: Response) => {
const token = signToken(domain, configModule, req.user, expiresIn);
Expand Down
146 changes: 99 additions & 47 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,14 @@
"@graphql-tools/utils" "8.12.0"
tslib "^2.4.0"

"@graphql-tools/merge@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-9.0.0.tgz#b0a3636c82716454bff88e9bb40108b0471db281"
integrity sha512-J7/xqjkGTTwOJmaJQJ2C+VDBDOWJL3lKrHJN4yMaRLAJH3PosB7GiPRaSDZdErs0+F77sH2MKs2haMMkywzx7Q==
dependencies:
"@graphql-tools/utils" "^10.0.0"
tslib "^2.4.0"

"@graphql-tools/optimize@^1.3.0":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-1.3.1.tgz#29407991478dbbedc3e7deb8c44f46acb4e9278b"
Expand All @@ -1619,13 +1627,38 @@
tslib "^2.4.0"
value-or-promise "1.0.11"

"@graphql-tools/schema@^10.0.0":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-10.0.0.tgz#7b5f6b6a59f51c927de8c9069bde4ebbfefc64b3"
integrity sha512-kf3qOXMFcMs2f/S8Y3A8fm/2w+GaHAkfr3Gnhh2LOug/JgpY/ywgFVxO3jOeSpSEdoYcDKLcXVjMigNbY4AdQg==
dependencies:
"@graphql-tools/merge" "^9.0.0"
"@graphql-tools/utils" "^10.0.0"
tslib "^2.4.0"
value-or-promise "^1.0.12"

"@graphql-tools/utils@8.12.0", "@graphql-tools/utils@^8.8.0":
version "8.12.0"
resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.12.0.tgz#243bc4f5fc2edbc9e8fd1038189e57d837cbe31f"
integrity sha512-TeO+MJWGXjUTS52qfK4R8HiPoF/R7X+qmgtOYd8DTH0l6b+5Y/tlg5aGeUJefqImRq7nvi93Ms40k/Uz4D5CWw==
dependencies:
tslib "^2.4.0"

"@graphql-tools/utils@^10.0.0":
version "10.0.8"
resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-10.0.8.tgz#c7b84275ec83dc42ad9f3d4ffc424ff682075759"
integrity sha512-yjyA8ycSa1WRlJqyX/aLqXeE5DvF/H02+zXMUFnCzIDrj0UvLMUrxhmVFnMK0Q2n3bh4uuTeY3621m5za9ovXw==
dependencies:
"@graphql-typed-document-node/core" "^3.1.1"
cross-inspect "1.0.0"
dset "^3.1.2"
tslib "^2.4.0"

"@graphql-typed-document-node/core@^3.1.1":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861"
integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==

"@grpc/grpc-js@~1.7.0":
version "1.7.3"
resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.7.3.tgz#f2ea79f65e31622d7f86d4b4c9ae38f13ccab99a"
Expand Down Expand Up @@ -2931,14 +2964,14 @@
semver "^7.3.5"
tar "^6.1.11"

"@medusajs/link-modules@^0.1.1":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@medusajs/link-modules/-/link-modules-0.1.1.tgz#7a5bf46366fd1dfd1e464daf2edf46a426937c62"
integrity sha512-zwn4GaAl2daycwL3//PB5VFlxT3D+bJicxL6bfEoELemvgWbcMdkeO8fQ/pix1JTjz9WDkldqXAS2LhFK0rbuw==
"@medusajs/link-modules@^0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@medusajs/link-modules/-/link-modules-0.2.3.tgz#6193d95977d5e618ee218f75f205a4fa4d4d189e"
integrity sha512-zebvSoLia0W6NbgMrxwql4Ghudx+8Uc2ESNfX+bf56efJz7Uk+NDXhbKWQXSK/oHtxPXuJM0vbGDtvWOa0MK5A==
dependencies:
"@medusajs/modules-sdk" "^1.11.0"
"@medusajs/types" "^1.11.1"
"@medusajs/utils" "^1.10.1"
"@medusajs/modules-sdk" "^1.12.3"
"@medusajs/types" "^1.11.6"
"@medusajs/utils" "^1.10.5"
"@mikro-orm/core" "5.7.12"
"@mikro-orm/postgresql" "5.7.12"
awilix "^8.0.0"
Expand Down Expand Up @@ -3056,17 +3089,17 @@
qs "^6.10.3"
retry-axios "^2.6.0"

"@medusajs/medusa@^1.17.0":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@medusajs/medusa/-/medusa-1.17.0.tgz#bc9766f5cf872b2dbc4c1c8998b34c4c1a0364fd"
integrity sha512-p4kuMN4RKoIfM67ox9fm8s8zTd0K6I7f5PwoQh6Hkic65eUVbJ6CeHiR+QgzBGdr7gVrMlPoONtzK/v8UX7paA==
"@medusajs/medusa@>=1.17.x":
version "1.17.4"
resolved "https://registry.yarnpkg.com/@medusajs/medusa/-/medusa-1.17.4.tgz#c03de82fe8a3f81a1774ac1fb37749a822e6e427"
integrity sha512-4IjgliiPF0JMDnBEsR/TlY3wdRUgIDXqIi9ZYzMVs3kHnUraR6h5FNhs/9jeVP95FwqWDS1spDIBpDqWu93EzA==
dependencies:
"@medusajs/link-modules" "^0.1.1"
"@medusajs/link-modules" "^0.2.3"
"@medusajs/medusa-cli" "^1.3.21"
"@medusajs/modules-sdk" "^1.11.3"
"@medusajs/orchestration" "^0.4.1"
"@medusajs/utils" "^1.10.2"
"@medusajs/workflows" "^0.2.3"
"@medusajs/modules-sdk" "^1.12.3"
"@medusajs/orchestration" "^0.4.4"
"@medusajs/utils" "^1.10.5"
"@medusajs/workflows" "^0.2.5"
awilix "^8.0.0"
body-parser "^1.19.0"
boxen "^5.0.1"
Expand Down Expand Up @@ -3228,26 +3261,28 @@
medusa-telemetry "^0.0.16"
resolve-cwd "^3.0.0"

"@medusajs/modules-sdk@^1.11.0", "@medusajs/modules-sdk@^1.11.3":
version "1.11.3"
resolved "https://registry.yarnpkg.com/@medusajs/modules-sdk/-/modules-sdk-1.11.3.tgz#741e422fecb4916fc7dfed4ec3110834476c2246"
integrity sha512-Kkh68uBMdFAAnuesojchGvyLesFj4juhsTazkewWdOHH5X3HUKFQ0tbdhTBZeM6lr+inmKo83YmIgheTLogHmA==
"@medusajs/modules-sdk@^1.12.3":
version "1.12.3"
resolved "https://registry.yarnpkg.com/@medusajs/modules-sdk/-/modules-sdk-1.12.3.tgz#c6fc6ca48a351dd7db7cbda26af993265ee7ec73"
integrity sha512-r95PKgf+ndRXNCFQtunTb1PBwCuP3AjlS3WHktSprSbsvXIBFiLV9v1WFmLp/yC8W/+z/rMMVA3nm5DMLk30Rw==
dependencies:
"@medusajs/orchestration" "^0.4.1"
"@medusajs/types" "^1.11.2"
"@medusajs/utils" "^1.10.2"
"@graphql-tools/merge" "^9.0.0"
"@graphql-tools/schema" "^10.0.0"
"@medusajs/orchestration" "^0.4.4"
"@medusajs/types" "^1.11.6"
"@medusajs/utils" "^1.10.5"
awilix "^8.0.0"
knex "2.4.2"
pg "^8.11.2"
resolve-cwd "^3.0.0"

"@medusajs/orchestration@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@medusajs/orchestration/-/orchestration-0.4.1.tgz#01dfb24859709670338e03e08256b2cf44bba9a8"
integrity sha512-rtg4eNlxcwVQXkNMji12TR6EP4aMSxUlxZvpfZcji7hx6T5cW0lrqlWbdjX9dQAeP0UsF2sGLnODmWEL9hGdbA==
"@medusajs/orchestration@^0.4.4":
version "0.4.4"
resolved "https://registry.yarnpkg.com/@medusajs/orchestration/-/orchestration-0.4.4.tgz#69e4dfe30b5a01fc7b4049d9827c612524b351d1"
integrity sha512-JRS2g4DX8POn8b5W6vTBE3yvQuDF5VPOMS1e4Owhg9hjJ6p+mIuPju7RheKj6dZ2KtQjPT5sCSHpscVUca/z1w==
dependencies:
"@medusajs/types" "^1.11.2"
"@medusajs/utils" "^1.10.2"
"@medusajs/types" "^1.11.6"
"@medusajs/utils" "^1.10.5"
awilix "^8.0.0"
graphql "^16.6.0"

Expand All @@ -3256,16 +3291,16 @@
resolved "https://registry.yarnpkg.com/@medusajs/types/-/types-1.8.3.tgz#d0408caaa8f310d25b1890735071befeb8d9d4d9"
integrity sha512-s5EWRNFmysI3KiqNhTN8P/VfgDDs3eBlEsoll4NsBSkQnKakGeLx3R8FYp05p56FCazTD26wnWLeSOF9JWCJCg==

"@medusajs/types@^1.11.1", "@medusajs/types@^1.11.2":
version "1.11.2"
resolved "https://registry.yarnpkg.com/@medusajs/types/-/types-1.11.2.tgz#a12de0b8df4b0c0e822e0935ee2dcf45347d67da"
integrity sha512-4+k32og+dFd5Qe5dK9Wug1kX/IZefSWX0zZgOYxSFt4WAKQJ8D1vbUr8CslHB+EH9ZDBEgZurf0iPrTNjHdZ/g==

"@medusajs/types@^1.11.4":
version "1.11.5"
resolved "https://registry.yarnpkg.com/@medusajs/types/-/types-1.11.5.tgz#83a697a8ced531ec2aecdd5d90b556fcb5833aa4"
integrity sha512-hoZ7FEFZqMiUItmMT2FmvG2tp1iygMqriepyIGMjoAWKJsNl3pfJDYgi4vvaVJjLuY5GCsiuXrvfAA/ngnw+dQ==

"@medusajs/types@^1.11.6":
version "1.11.6"
resolved "https://registry.yarnpkg.com/@medusajs/types/-/types-1.11.6.tgz#1f9421acdba6401d3727e785c2f4a6f2574f8ed8"
integrity sha512-vTKCyYbflniuevg8HSgLSES+EBtdit9LF4iBYRyQBn+2Ra6ddfcDVn6ORA5qXYE3fauGe3c6te5atPLhS0fGOQ==

"@medusajs/utils@1.8.2":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@medusajs/utils/-/utils-1.8.2.tgz#e398c5c7e99a7802a5340db4cb38ce513c46dae4"
Expand All @@ -3277,7 +3312,7 @@
typeorm "^0.3.14"
ulid "^2.3.0"

"@medusajs/utils@^1.10.0", "@medusajs/utils@^1.10.1":
"@medusajs/utils@^1.10.0":
version "1.10.4"
resolved "https://registry.yarnpkg.com/@medusajs/utils/-/utils-1.10.4.tgz#31a85b086aabcf0a6a19dfe7643f90415f788bc1"
integrity sha512-qNZQnd28mQ3xh48qXq3xtokZSKsOI2D3YK7Z3GDib3NwHKyDP0YBEY1+5VZAlj3Nte+92bLHrvSTBD0wAawghQ==
Expand All @@ -3290,27 +3325,27 @@
knex "2.4.2"
ulid "^2.3.0"

"@medusajs/utils@^1.10.2":
version "1.10.2"
resolved "https://registry.yarnpkg.com/@medusajs/utils/-/utils-1.10.2.tgz#86b52ca7a9be4450dc5365c5bc6871d03313190d"
integrity sha512-2n9xiKL285FJEhd/YqC+GHxNjPbRqofKlgdCCAm8bdDQV+r57cZecrQo991WXw3fH1zcczoQrASyLBX0jv+X1A==
"@medusajs/utils@^1.10.5":
version "1.10.5"
resolved "https://registry.yarnpkg.com/@medusajs/utils/-/utils-1.10.5.tgz#25d085f41f02222d9a65a9fe35ae971eafbf0f9d"
integrity sha512-2Fz8mVg2yemsOmcS04OhXLmC18fK7bibu/y+EW84voCEYot4T+2TXQx6ZcrRjuuTWj7aSTtVVN1HN5yFvTrH3A==
dependencies:
"@medusajs/types" "^1.11.2"
"@medusajs/types" "^1.11.6"
"@mikro-orm/core" "5.7.12"
"@mikro-orm/migrations" "5.7.12"
"@mikro-orm/postgresql" "5.7.12"
awilix "^8.0.1"
knex "2.4.2"
ulid "^2.3.0"

"@medusajs/workflows@^0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@medusajs/workflows/-/workflows-0.2.3.tgz#352a2f84c5ff6b515bbddefc3e33937c52f43068"
integrity sha512-KcYqrOayDdwvojI9dDf39f/7YS55w627X1izoXbfrjjbHlJaFHBGzX6YYPsoC8k0q6IQiOaTpCmMBvgydHTuqg==
"@medusajs/workflows@^0.2.5":
version "0.2.5"
resolved "https://registry.yarnpkg.com/@medusajs/workflows/-/workflows-0.2.5.tgz#3a2258a178debf428034cb6d0249e191ecdb12d1"
integrity sha512-arLxM/Qru/pqFb/4UPwMwV2qack+kwXP8yNwUn+NHLhwZ41EWTl8wXSEJql/KuEYKCWxYmfMXQSBRRjrc+MREg==
dependencies:
"@medusajs/modules-sdk" "^1.11.3"
"@medusajs/orchestration" "^0.4.1"
"@medusajs/utils" "^1.10.2"
"@medusajs/modules-sdk" "^1.12.3"
"@medusajs/orchestration" "^0.4.4"
"@medusajs/utils" "^1.10.5"
awilix "^8.0.1"
ulid "^2.3.0"

Expand Down Expand Up @@ -7668,6 +7703,13 @@ cross-fetch@^3.1.5:
dependencies:
node-fetch "2.6.7"

cross-inspect@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/cross-inspect/-/cross-inspect-1.0.0.tgz#5fda1af759a148594d2d58394a9e21364f6849af"
integrity sha512-4PFfn4b5ZN6FMNGSZlyb7wUhuN8wvj8t/VQHZdM4JsDcruGJ8L2kf9zao98QIrBPFCpdk27qst/AGTl7pL3ypQ==
dependencies:
tslib "^2.4.0"

cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
Expand Down Expand Up @@ -8346,6 +8388,11 @@ dotenv@^8.2.0, dotenv@^8.6.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==

dset@^3.1.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.3.tgz#c194147f159841148e8e34ca41f638556d9542d2"
integrity sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==

dtrace-provider@~0.8:
version "0.8.8"
resolved "https://registry.yarnpkg.com/dtrace-provider/-/dtrace-provider-0.8.8.tgz#2996d5490c37e1347be263b423ed7b297fb0d97e"
Expand Down Expand Up @@ -18601,6 +18648,11 @@ value-or-promise@1.0.11:
resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140"
integrity sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==

value-or-promise@^1.0.12:
version "1.0.12"
resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.12.tgz#0e5abfeec70148c78460a849f6b003ea7986f15c"
integrity sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==

vary@^1, vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
Expand Down

0 comments on commit 6774541

Please sign in to comment.