Comments (4)
The issue is reproducible also using the admin dashboard, when you try to edit metadata of a user you get an error and then you cannot access anymore the user
from supertokens-core.
@edubacco the getUser function doesn't required a tenantId
. It should be able to get any user within the app, across all tenants. When you say it seems to work only for public tenant, are you getting an UNKNOWN_USER_ID
when you pass the userId of the user on customTenant?
from supertokens-core.
We miss a detail: the bug is related to the "update metadata" recipe.
A test to reproduce it:
import { getTestApp } from "../support/test_app"
import { Express } from "express"
import { expect } from "chai"
import { signInUp, updateUser } from "supertokens-node/recipe/passwordless"
import supertokens from "supertokens-node"
import { inspect } from "node:util"
import { faker } from "@faker-js/faker"
import { updateUserMetadata } from "supertokens-node/recipe/usermetadata"
describe.only("GET /admin/tenantId/users/userId", () => {
let app: Express
before(async () => {
const testApp = await getTestApp()
app = testApp.app
})
it("public ternant works", async () => {
const publicUserEmail = "[email protected]"
const publicUser = await signInUp({ tenantId: "public", email: publicUserEmail })
const foundUser = await supertokens.getUser(publicUser.recipeUserId.getAsString())
expect(foundUser?.emails).contain(publicUserEmail)
})
it.only("custom tenant works", async () => {
const customUserEmail = "[email protected]"
const customUser = await signInUp({ tenantId: "ucsc", email: customUserEmail })
const foundUser1 = await supertokens.getUser(customUser.recipeUserId.getAsString())
expect(foundUser1?.emails).contain(customUserEmail)
const responsePhone = await updateUser({
recipeUserId: customUser.recipeUserId,
phoneNumber: faker.phone.number().replace(/ /g, ""),
email: customUserEmail,
})
const foundUser2 = await supertokens.getUser(customUser.recipeUserId.getAsString())
expect(foundUser2?.emails).contain(customUserEmail)
const responseMetadata = await updateUserMetadata(customUser.recipeUserId.getAsString(), {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
})
const foundUser3 = await supertokens.getUser(customUser.recipeUserId.getAsString())
console.log(inspect(foundUser3))
expect(foundUser3?.emails).contain(customUserEmail)
})
})
from supertokens-core.
This has been fixed in core version >= 8.0
from supertokens-core.
Related Issues (20)
- Unhandled exception error in backend when connecting core to aws RDS postgresql HOT 16
- add tiktok to builtin provider
- Self-hosted package installation fail HOT 2
- Logs contains the mysql password when failing to connect to the database HOT 6
- FastAPI setup issue HOT 1
- third party middleware for passwordless authentication HOT 1
- Strategies for Bulk User Import into SuperTokens HOT 6
- [RELEASE]: Change in dynamic signing key
- Supertokens seems to convert OIDC discovery URLs to lower case which cause the IDP to return a 404 HOT 1
- UserId is already in use in Session recipe HOT 1
- Vulnerabilities in latest supertokens-mysql Docker image HOT 1
- [RELEASE]: Auth mode any should take what is used by the suer
- Issue with non-auth recipes in multitenancy
- Do not try to determine storage in API layer HOT 1
- Scheduler Component Symfony 6.4
- ':supertokens-plugin-interface' could not be found HOT 1
- [RELEASE]: MFA
- Support ECMAScript Modules in examples and create-supertokens-app
- Make recipe enabled booleans better HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supertokens-core.