https://supertokens.com/
Join Discord
<@498057949541826571> did you train the chatbot on the discord data?
r

robschilder

over 2 years ago
@rp_st did you train the chatbot on the discord data?
r
r
  • 2
  • 5
  • 35
Hi, Anyone know why when I implement the `getUserById` in `nestjs`, it return me ```shell [Nest] 12...
c

clean9326

almost 3 years ago
Hi, Anyone know why when I implement the
getUserById
in
nestjs
, it return me
shell
[Nest] 1229  - 18/02/2023, 3:49:21 pm   ERROR [ExceptionsHandler] Initialisation not done. Did you forget to call the SuperTokens.init function?
Error: Initialisation not done. Did you forget to call the SuperTokens.init function?
    at Function.getInstanceOrThrowError (/Users/xxx/Desktop/projects/chatgpt-studywithme/chatgpt-studywithme/backend/node_modules/supertokens-node/lib/build/recipe/thirdpartyemailpassword/recipe.js:229:15)
    at Function.getUserById (/Users/bytedance/Desktop/projects/chatgpt-studywithme/chatgpt-studywithme/backend/node_modules/supertokens-node/lib/build/recipe/thirdpartyemailpassword/index.js:82:33)
    at UserController.getUserInfo (/Users/xxx/Desktop/projects/chatgpt-studywithme/chatgpt-studywithme/backend/src/user/user.controller.ts:15:52)
my code is like:
ts
@Controller('user')
export class UserController {
  @Get()
  @UseGuards(new AuthGuard()) // For more information about this guard please read our NestJS guide.
  async getUserInfo(@Session() session: SessionContainer): Promise<User> {
    const userId = session.getUserId();
    // You can learn more about the `User` object over here https://github.com/supertokens/core-driver-interface/wiki
    const userInfo = await ThirdPartyEmailPassword.getUserById(userId);
    //....
    return userInfo;
  }
}
c
r
  • 2
  • 12
  • 35
is there a way to list all users?
v

Vrl

about 3 years ago
is there a way to list all users?
v
r
  • 2
  • 1
  • 35
Any reason why CORS would fail with `Access to fetch at 'http://localhost:3000/v1/auth/signin' from ...
n

nickm91.

over 3 years ago
Any reason why CORS would fail with
Access to fetch at 'http://localhost:3000/v1/auth/signin' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.
cors:
app.enableCors({
    origin: "http://localhost:4200",
    allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()],
    credentials: true,
  });
backend config:
{
  config: {
    appInfo: {
      appName: 'app',
      apiDomain: 'http://localhost:3000',
      websiteDomain: 'http://localhost:4200',
      apiBasePath: '/v1/auth',
      websiteBasePath: '/auth'
    },
    connectionURI: 'http://auth:3567',
    apiKey: 'supersecret'
  }
}
frontend config:
apiBasePath: "/v1/auth"
apiDomain: "http://localhost:3000"
appName: "app"
websiteBasePath: "/auth"
websiteDomain: "http://localhost:4200"
EDIT: using nestjs
n
r
  • 2
  • 9
  • 35
Hey, I'm trying to setup Apollo graphql + Nest.js by following the guide, and I manage to get the se...
i

idanh

over 3 years ago
Hey, I'm trying to setup Apollo graphql + Nest.js by following the guide, and I manage to get the session info on a controller using the Auth guard and Session param decorator (from the guide) but not on a resolver. I tried (with inspiration from the graphql integration guide) to use a CanActivate guard and access the session with
GqlExecutionContext.create(context)
and also tried injecting the session param to the resolver with
export const User = createParamDecorator(
  (data: unknown, ctx: ExecutionContext) => {
    const x = GqlExecutionContext.create(ctx);
    const context = x.getContext();
    return context.session;
  },
);
with no success and couldn't find any code example that combines graphql + nest
i
r
+2
  • 4
  • 44
  • 35
hey <@498057949541826571> I am using passwordless. i am trying to do something after user registers....
a

aV

over 3 years ago
hey @rp_st I am using passwordless. i am trying to do something after user registers. For now I am just printing in the backend after a new regisration. when try to enter a code or use magic link to verify the backend sdk crashes. I tried this override:
a
r
  • 2
  • 10
  • 35
Hey, i got a little problem after enabling email verification at EmailPassword recipe. ```javascript...
t

TELYA

over 3 years ago
Hey, i got a little problem after enabling email verification at EmailPassword recipe.
javascript
EmailPassword.init({
  emailVerificationFeature: {
    mode: "REQUIRED"
   }
})
I noticed this every time when i signup successfully i received two email verification email instead of one. I started to digging why this is happened and i added the createAndSendCustomEmail option to my backend setup
typescript
EmailPasswordNode.init({
  emailVerificationFeature: {
    createAndSendCustomEmail: async (user, emailVerificationURLWithToken) => {
      console.log(user, emailVerificationURLWithToken);
    }
  }
})
The callback fired 2 times after every successful signup. I assume the root of the problem is with my frontend setup because it is the only one who is calling my backend. Do you have guys any idea what i did wrong ? 😅
t
n
  • 2
  • 19
  • 35
How about storing user tokens in a redis cache db?
λ

Λ C Ξ L X R D

over 3 years ago
How about storing user tokens in a redis cache db?
λ
r
  • 2
  • 2
  • 35
Guest Author Program…
m

mizzle

over 1 year ago
Hi @Koha sent you a dm regarding this
m
k
  • 2
  • 3
  • 34
Hey there, is there a way to autostart supertokens on ubuntu? After restart it's not automatic
r

ricardas4658

over 1 year ago
Hey there, is there a way to autostart supertokens on ubuntu? After restart it's not automatic
r
r
d
  • 3
  • 14
  • 34
Previous353637Next

SuperTokens.com

SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).

Powered by