https://supertokens.com/ logo
Join Discord
Powered by
# support-questions-legacy
  • n

    nikachu5338

    04/10/2024, 5:40 PM
    Hello, I would like to add a custom login and signup UI to my application. Could someone please point me to the doc or an example application for it? I found this: https://supertokens.com/docs/emailpassword/custom-ui/init/frontend, but it's not really detailed on how to use it.
    r
    • 2
    • 3
  • s

    Sekai

    04/10/2024, 10:46 PM
    How can I revoke session, if any, in the backendConfig in passwordResetPost? The reason why I want this is because I implemented auto login but their could be issues with it when a session already exists. I tried looking into the input.options.req but none of the tools it has seems useful.
    r
    • 2
    • 2
  • m

    mvilrokx

    04/11/2024, 5:05 AM
    Hi, I am trying to integrate Supertokens with echo-labstack. I followed this example https://github.com/supertokens/supertokens-golang/blob/master/examples/with-labstack-echo/main.go. Echo advocates to return errors from your Handlers, which will then be handled by their HTTP Error Handler (which you can customize). This works fine until I introduce the session.VerifySession in my middleware, as per the example (wrap it to turn it into a echo.MiddlewareFunc). As soon as I use this middleware on my routes, they always return
    200
    (empty body), no matter how may errors I return from my handlers. As soon as I remove the session.VerifySession echo'fied middleware, I get the actual errors. It seems as if the session.VerifySession middleware is swallowing the echo error and just returning a
    200
    instead. Anybody any idea what could be causing this?
    r
    • 2
    • 7
  • m

    mnky_js

    04/11/2024, 6:50 AM
    Hi I've got a problem with Angular + Capacitor + Supertokens. In the web version everything works perfectly but when I test the app in iOS for example, then after the login the refresh call of doom is starting ๐Ÿ˜„
    r
    r
    • 3
    • 32
  • m

    msalar

    04/11/2024, 6:50 AM
    Hi Everyone. I have a problem regarding sessions that I'm running into I would like to post the complete thing with the code as well. So I will be posting this in parts as a thread. For starters we are a YC startup and we're using SuperTokens' managed instance as our authentication layer. The frontend is based on
    Next.js
    and the backend is using
    Nest.js
    r
    p
    • 3
    • 78
  • d

    davide.debernardi

    04/11/2024, 7:11 AM
    Hello everyone, I am trying to figure out the correct way of implementing a single-tenant login flow with social login that can work with both web and mobile clients. At the moment I'm using supertokens-node
    16.6.8
    with core
    7.x
    . The issue I am facing is that web is working fine, but when trying to login with Google from an iOS client, google is returning
    401
    with
    unauthorized_client
    . I was reading the docs at the bottom of this message, but I have the following questions: 1. do I need to provide separate client configurations? 2. can I provide separate client configurations for all social login providers? 3. I see there is a parameter called
    clientType
    , is it just an arbitrary string? Thanks in advance for supporting! https://supertokens.com/docs/thirdpartypasswordless/custom-ui/thirdparty-login#social--sso-login-for-both-web-and-mobile-apps
    r
    • 2
    • 20
  • a

    anuj6163

    04/11/2024, 8:03 AM
    hello everyone, I wanted to implement social login with custom UI, but i am getting below error auth.service.ts:24 GET http://localhost:8000/api/auth/authorisationurl?thirdPartyId=google&redirectURIOnProviderDashboard=http%3A%2F%2Flocalhost%3A8000%2Fauth%2Fcallback 400 (Bad Request) {"message":"the provider google could not be found in the configuration"} i am using fastapi for backend and angular for frontend fastapi this is my RecipeList RECIPE_LIST = [ session.init(), thirdpartyemailpassword.init( sign_up_feature = thirdpartyemailpassword.InputSignUpFeature( form_fields=[InputFormField(id='email'), InputFormField(id='password'), InputFormField(id='firstName'), InputFormField(id='lastName'), InputFormField(id='phone') ], )), thirdparty.init( sign_in_and_up_feature=thirdparty.SignInAndUpFeature(providers=[ ProviderInput( config=ProviderConfig( third_party_id="google", clients=[ ProviderClientConfig( client_id="1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com", client_secret="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", ), ], ) ) ]) ), dashboard.init() ]
    r
    r
    • 3
    • 13
  • a

    anuj6163

    04/11/2024, 8:03 AM
    and on frontend socialLogin(provider: string) { this.authService.thirdPartyLogin(provider); } async thirdPartyLogin(provider: string): Promise { let response = await ThirdPartyEmailPassword.getAuthorisationURLWithQueryParamsAndSetState({ frontendRedirectURI:
    localhost:3000/auth/callback
    , thirdPartyId: provider }) this.route.navigate([response]); } auth.routes.ts export const AuthRoutes: Routes = [ { path: '', component: AuthComponent, children: [ { path: '', redirectTo: 'login', pathMatch: 'full' }, { path: 'callback', component: CallbackComponent, title: 'Auth | Callback', }, { path: 'login', component: LoginComponent, title: 'Auth | Login' }, { path: 'logout', component: LogoutComponent, title: 'Auth | Logout' }, { path: 'register', component: RegisterComponent, title: 'Auth | Register', }, { path: 'forgot-password', component: ForgotPasswordComponent, title: 'Auth | Forgot Password', }, { path: 'reset-password', component: ResetPasswordComponent, title: 'Auth | Reset Password', }, ], }, ];
  • a

    anuj6163

    04/11/2024, 8:03 AM
    App.component.ts export class AppComponent implements OnInit { ngOnInit(): void { SuperTokens.init({ appInfo: { apiDomain: "http://localhost:8000", apiBasePath: "/api/auth", appName: "...", }, recipeList: [ Session.init(), ThirdPartyEmailPassword.init(), ], }); }
  • w

    wendytrns

    04/11/2024, 11:49 AM
    Hi all, I'm new to SuperTokens. I'm using PasswordLess authentication. I have followed the recipe. I do have a nice Sign In which is quite straightforward and works well, thanks for that! However, I don't have any *SIGN UP * and I don't get why. I added the first users through the Supertokens UI. I'm using NextJS. My back-end config is the following :
    Copy code
    return {
        debug: true,
        framework: "custom",
        supertokens: {
          connectionURI:
            process.env.SUPERTOKENS_URI || "https://try.supertokens.com",
          apiKey: process.env.SUPERTOKENS_API_KEY,
        },
        appInfo: appInfo("backend"),
        recipeList: [
          PasswordlessNode.init({
            flowType: "MAGIC_LINK",
            contactMethod: "EMAIL",
            emailDelivery: {...}
          }),
          SessionNode.init(),
          Dashboard.init(),
          UserRoles.init(),
          UserMetadata.init(),
        ],
        isInServerlessEnv: true,
      };
    };
    Could somebody help me?
    r
    • 2
    • 22
  • l

    Lucifer979

    04/11/2024, 2:02 PM
    Hey @rp_st I have intergrated user login using google, On frontend how I can get the user information after login, like userId?
    r
    • 2
    • 1
  • a

    aleeza333

    04/12/2024, 9:19 AM
    Hello! I am trying to implement OTP in my Android app but the SuperTokens object isn't saving the session information. I am wondering if I initialized SuperTokens incorrectly (or something else) SuperTokens.Builder(applicationContext, apiDomain) .apiBasePath("/api/auth") .build() I can hit apiDomain on my local machine so we can assume this is correct I can see all the session data that I want in the response in logcat but I somehow can't access it in the SuperTokens object
    r
    • 2
    • 6
  • m

    mr.lurs

    04/13/2024, 12:09 PM
    Hi @rp_st ! I am trying to import users from one supertokens db (postgres) to another db (also postgres). They are all social login users . I found this request (POST 'http://localhost:3567/recipe/signinup') which would work great however I need to keep the existing userIds from the old db and the schema of the request does not include such a field. Is there a way to achieve this?
  • d

    Darko

    04/13/2024, 2:52 PM
    hey @mr.lurs! we're migrating to forum based support so that everyone has a better experience. Support questions should go to #1224328457589227540
  • t

    Tushar

    04/17/2024, 4:18 AM
    Hello team, for my development environment api domain and website domain are same which is why sameSite is set to strict by the sdk . This makes it difficult for the testing purposes where the frontend localhost needs to consume backend development environments as it prevents because localhost is treated as third party . I read the docs and found out a way to manually set the cookieSameSite=None in the init which will solve the problem but will compromise the security as the system would be more prone to csrf attacks , is there any other recommended way to do it ?
    r
    • 2
    • 5
  • r

    rubenstolk

    04/17/2024, 8:02 AM
    Hi team - we're struggling to implement MFA using SMS. We find the documentation to be very confusing and are not really able to get clarity on the way forward. Who can guide us here?
    r
    • 2
    • 2
  • r

    rubenstolk

    04/17/2024, 8:02 AM
    (We don't use pre-built UI)
  • d

    Darko

    04/17/2024, 8:40 AM
    hey @rubenstolk, please as any future questions in #1224328457589227540 - everyone benefits that way ๐Ÿ™‚
  • g

    gsj

    04/18/2024, 11:23 AM
    Hi, I'm getting this error when i tried to create a new role through User Management Dashboard
    Error: SuperTokens core threw an error for a PUT request to path: '/recipe/role' with status code: 500 and message: Internal Error
    Any idea what could be the issue. thanks for the help!
    r
    • 2
    • 15
  • d

    Darko

    04/18/2024, 11:41 AM
    hey @gsj! This time next week, this channel will become read-only. Please ask any future question in #1224328457589227540, so that everyone gets better experience.
  • l

    Lucas Dias

    04/18/2024, 5:52 PM
    Hi, I currently use supertokens-node in my backend using passwordless authentication. When my client enters the OTP code sent via email, Supertokens checks if the entered code matches. If it's different, it throws an error INCORRECT_USER_INPUT_CODE_ERROR, and if the code is correct, it calls the createNewSession method of ThirdPartyPasswordless. I'd like to allow login for my email with the code 000000 always. I tried to override the method that performs this validation but couldn't succeed. I'd like to know which method performs this validation, if it's possible to override it, and how it would look in my code. thanks!
    r
    d
    • 3
    • 17
  • t

    tomita0022

    04/19/2024, 12:02 PM
    @rp_st when i installing supertokens self-hosted core application in windows, this errro occurs.
    r
    • 2
    • 2
  • a

    albatroz

    04/20/2024, 8:15 PM
    @rp_st Why does it take time to validate role claim? I signed up a user, added a role got this log
    Copy code
    roles.go:94: [Info] Role added to user: &{false} with user_id:702116bc-1a9f-4a1c-b71e-3d74d9c0fce4 role: admin
    but i can't call endpoint with role claim validator it eventually works, but i am not sure about the exact time calling this returns role as admin
    Copy code
    go
        admin.Get("/auth/role", func(c *fiber.Ctx) error {
            sessionContainer := session.GetSessionFromRequestContext(c.UserContext())
    
            response, err := userroles.GetRolesForUser("public", sessionContainer.GetUserID(), nil)
    
            if err != nil {
                log.Errorf("Error getting roles: %v", err)
                return util.ReturnError(c, 500, "Error getting roles")
            }
            return util.ReturnSuccess(c, response.OK.Roles)
        })
    r
    • 2
    • 3
  • t

    tomita0022

    04/22/2024, 6:25 AM
    hello.@rp_st when resetting password, how can I detect if newPassword is the same as old one? supertokens server is selfhosted, and is seperated from api backend. the only receives when resetting password are just password and token.
    r
    • 2
    • 42
  • h

    heneftees

    04/22/2024, 7:52 AM
    Is there a recipe for: Passwordless (SMS/Email), Email password, and SSO?
  • h

    heneftees

    04/22/2024, 7:54 AM
    This is what I see closest to that but it doesnt include email password
    r
    • 2
    • 2
  • d

    Darko

    04/22/2024, 8:23 AM
    @tomita0022 @albatroz @heneftees gentle reminder that we're making this channel read-only on Friday. All questions should go to #1224328457589227540 from now on, since it's a better experience for everyone involved. Thanks!
  • h

    heneftees

    04/22/2024, 8:27 AM
    Thanks @Darko . Posted my message instead on the new channel
  • d

    Darko

    04/22/2024, 8:29 AM
    thanks @heneftees
  • d

    Darko

    04/26/2024, 12:24 PM
    Okay folks, so the time has come. This channel is going read only - all future support questions should go to #1224328457589227540. Long announcement and updates in #1228317461372207115