-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle tenant not found error #639
Conversation
@@ -9,6 +10,13 @@ export default function getAPIInterface(): APIInterface { | |||
userContext, | |||
}); | |||
|
|||
if (tenantConfigRes.status === "TENANT_NOT_FOUND_ERROR") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redo PR -> getTenant should return undefined if tenant not found
@@ -116,6 +117,13 @@ export default function getRecipeImplementation(querier: Querier, providers: Pro | |||
const mtRecipe = MultitenancyRecipe.getInstanceOrThrowError(); | |||
const tenantConfig = await mtRecipe.recipeInterfaceImpl.getTenant({ tenantId, userContext }); | |||
|
|||
if (tenantConfig === undefined) { | |||
throw new STError({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should return undefined
throw new STError({ | ||
type: "BAD_INPUT_ERROR", | ||
message: "Tenant not found", | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw a normal JS error which will eventually give 500
* fix: tp-rework interfaces, api impl * fix: todos * fix: iface change * fix: further changes in thirdparty recipe * fix: unused import * fix: added requireEmail * fix: minor fixes * fix: interfaces fixes + ad apple impl * fix: boxy, discord impl * fix: fb impl * fix: github impl * fix: github impl * fix: google and gw impl * fix: pr comments * fix: pr comments * fix: pr comments * fix: pr comments * fix: pr comments * fix: pr comments * fix: pr comments * fix: pr comments * fix: updated provider impls * fix: multitenancy recipe * fix: recipe fixes * fix: api impl fixes * fix: impl fixes * fix: tp-rework fixes * fix: tp-rework fixes * fix: tp-rework fixes * fix: linkedin and okta impl * fix: tp-rework fixes * fix: fixed tests * fix: fixed tests * fix: updated for tenantId in core * fix: rebuild * fix: router to handle tenantid (#592) * fix: router to handle tenantid * fix: pr comments * fix: pr comments * fix: pr comments * fix: multitenancy recipe (#594) * fix: impl and test * fix: version * fix: impl * fix: pr comments * fix: version update * fix: pr comments * fix: user context refactor (#595) * fix: first layer impl * fix: impl * fix: pr comment * fix: pr comments * fix: test for counting makeDefaultUserContext * fix: impl (#596) * fix: pr comment (#597) * fix: userroles mt impl (#600) * fix: multitenancy emailpassword impl (#602) * fix: recipe impl * fix: impl * fix: password reset link * fix: mt revert * fix: test * fix: pr comment * fix: tenantId compulsory in user roles recipe interface (#605) * fix: multitenancy passwordless implementation (#606) * fix: impl * fix: test * fix: cleanup * fix: tenantId in link * fix: tp and ev impl * fix: ev impl * fix: tp test * fix: test cross tenant resend code * fix: tenantId in link * fix: pr comments * fix: optional members in UserInfo * fix: type exports * fix: pr comments * fix: session recipe impl for multitenancy (#607) * fix: impl * fix: test * fix: cleanup * fix: tenantId in link * fix: tp and ev impl * fix: ev impl * fix: tp test * fix: test cross tenant resend code * fix: tenantId in link * fix: pr comments * fix: recipe impl * fix: test * fix: create new session * fix: test * fix: getTenantId * fix: pr comments * fix: pr comments * fix: pr comments * fix: dashboard multitenancy updates (#623) * fix: dashboard updates * fix: pr comments * fix: updating send email verification interface (#625) * fix: updating send email verification interface * fix: pr comments * fix: pr comments * fix: pr comments * fix: password reset email (#626) * fix: passwordless * fix: password reset in tpep * fix: rename functions * fix: tenantid in config functions (#627) * fix: passwordless * fix: password reset in tpep * fix: rename functions * fix: tenantId in types * fix: tenantId in types * fix: impl * fix: impl * fix: pr comments * fix: minor * Update lib/ts/recipe/emailpassword/utils.ts * Update lib/ts/recipe/emailverification/utils.ts * Update lib/ts/recipe/passwordless/utils.ts * Update lib/ts/recipe/thirdpartyemailpassword/utils.ts * Update lib/ts/recipe/thirdpartypasswordless/utils.ts --------- Co-authored-by: Rishabh Poddar <rishabh.poddar@gmail.com> * fix: missed param (#629) * fix: return updated access token after verification * test: fix clientId casing in tests * Update routing logic for Hapi and dashboard recipe to account for multitenancy (#631) * fix: test fixes (#630) * fix: test fixes * fix: claims build * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: cleanup * fix: tests * fix: tests * fix: pr comments * fix: remove error handlers in multitenancy recipe (#632) * fix: test fixes * fix: claims build * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: cleanup * fix: tests * fix: tests * fix: pr comments * fix: remove error handlers in multitenancy * fix: pr comments * fix: pr comments * fix: tenantid compulsory (#633) * fix: tenantid compulsory * fix: type fix * fix: type fix * fix: tenant id in get global claim validators (#634) * fix: tenant id in global claim validators * fix: pr comments * refactor: Remove core config from dashboard tenants list response (#635) * Remove core config from dashboard tenants list response * Update tenant list API logic * fix: Fix tenant id being passed in the wrong order for password update functions (#636) * Remove core config from dashboard tenants list response * Fix tenant id being passed in the wrong order for password update functions * Add user PUT api to list * Update tenant list API logic * Update CHANGELOG * fix: all tests fixes (#637) * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: test * fix: tests * fix: tests * fix: test (#638) * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: test * fix: tests * fix: tests * fix: tests * fix: handle tenant not found error (#639) * fix: handle tenant not found error * fix: pr comments * fix: pr comments * docs: convert next example to use app dir (#641) * fix: bitbucket gitlab impl and other fixes (#642) * fix: github * fix: user info * fix: discord and linkedin * fix: gitlab impl * fix: bitbucket impl * fix: tests fixes (#643) * fix: tests * fix: tests * fix: framework tests with tenantid in path * fix: tests * fix: google workspaces * fix: version updates and changelog (#645) * fix: tests * fix: tests * fix: framework tests with tenantid in path * fix: tests * fix: google workspaces * fix: version updates * chore: changelog * fix: pr comments * fix: pr comments * fix: pr comments * fix: pr comments * fix: pr comments * fix: auth react server (#647) * fix: auth-react-server * fix: auth-react-server * fix: example test (#648) * removes unnecessary import --------- Co-authored-by: Rishabh Poddar <rishabh.poddar@gmail.com> Co-authored-by: Mihaly Lengyel <mihaly@lengyel.tech> Co-authored-by: Nemi Shah <nemishah1212@gmail.com>
Summary of change
(A few sentences about this PR)
Related issues
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Documentation changes
(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)
Checklist for important updates
coreDriverInterfaceSupported.json
file has been updated (if needed)lib/ts/version.ts
frontendDriverInterfaceSupported.json
file has been updated (if needed)package.json
package-lock.json
lib/ts/version.ts
npm run build-pretty
git tag
) in the formatvX.Y.Z
, and then find the latest branch (git branch --all
) whoseX.Y
is greater than the latest released tag.add-ts-no-check.js
file to include thatsomeFunc: function () {..}
).Remaining TODOs for this PR