https://supertokens.com/ logo
Docs
Join the conversationJoin Discord
Channels
community
contributing
general
github-activity
info
introductions
new-releases
random
security
support-questions
welcome-0xdelusion
welcome-aj-ya
welcome-aleksandrc
welcome-alpinjs
welcome-amberlamps1
welcome-andrew-rodriguez
welcome-ankit-choudhary
welcome-anthony-stod-custodio
welcome-call-in
welcome-chwalbox
welcome-claybiokiller
welcome-co7e
welcome-cosmoecwsa
welcome-devdag
welcome-dinso
welcome-drebotelho
welcome-elio
welcome-ernest
welcome-foxbarrington
welcome-fromscratch
welcome-galto4ir
welcome-goetzum
welcome-hay-kot
welcome-himanshu-kukreja
welcome-hossambarakat
welcome-ichikawakazuto
welcome-jahir9991
welcome-jamesl
welcome-jerry123424
welcome-john-oliver
welcome-jonas-alexanderson
welcome-jxyz
welcome-kelvinwop
welcome-kraz
welcome-lancekey
welcome-leoo
welcome-lukeacollins
welcome-m-j-mon
welcome-malik-khoja
welcome-marco
welcome-mardadi
welcome-meshguy
welcome-metamorph
welcome-mike-tectu
welcome-mirzok
welcome-mozomig
welcome-naberyou66_
welcome-nacer
welcome-namratha
welcome-naveenkumar
welcome-nightlight
welcome-nischith
welcome-notankit
welcome-olawumi
welcome-pavan-kumar-reddy-n
welcome-pineappaul
welcome-poothebear
welcome-rick
welcome-samuel-qosenergy
welcome-samuelstroschein
welcome-shubhamgoel23
welcome-shubhamkaushal
welcome-sidebar
welcome-surajsli
welcome-suyash_
welcome-syntaxerror
welcome-tauno
welcome-tauno
welcome-tawnoz
welcome-teclali
welcome-tls
welcome-turbosepp
welcome-vikram_shadow
welcome-yann
Powered by Linen
support-questions
  • a

    aV

    07/18/2022, 5:53 PM
    yeah sure
  • v

    veritas

    07/18/2022, 6:39 PM
    Can I get some help with troubleshooting? I have a user who can't log in, but don't see any reason in the logs.
    r
    • 2
    • 69
  • a

    ArashiTempesta

    07/18/2022, 11:28 PM
    I have a question about the user roles recipe, it mentions a bit that you need to create a role before you want to assign it to a user. But its not so clear how you create the role. In this case, is it done with createNewRoleOrAddPermissions function? if you add the permisson "read" for the role "creator", lets say, the core will check that role exists and if it does not, will it create the role in the DB and then add the permission you passed? - EDIT: went to the core repo and looked the function it has a comment confirming what I asked.
  • k

    Killian

    07/19/2022, 4:28 AM
    Hello I'm trying to use the new roles that have been released but It's seem that I'm unable to, I think It's because the core is outdated which is managed by Supertokens?
  • k

    Killian

    07/19/2022, 4:28 AM
    javascript
    const createRole = async () => {
      const response = await UserRoles.createNewRoleOrAddPermissions("user", []);
    
      console.log(response);
    
      if (response.createdNewRole === false) {
        console.log("Role already exists");
      }
    };
    
    createRole();
  • k

    Killian

    07/19/2022, 4:29 AM
    throw new Error( ^ Error: SuperTokens core threw an error for a PUT request to path: '/recipe/role' with status code: 404 and message: Not found
  • r

    rp

    07/19/2022, 4:31 AM
    @Killian you can email us from your registered email ID on team@supertokens.com to update the core to the latest version. And we will do that. Please specify if you’d like to update both (dev and prod) envs or just one.
  • k

    Killian

    07/19/2022, 4:31 AM
    Ok, thank you! I will do that now!
  • j

    Jota

    07/19/2022, 11:45 AM
    Hey guys, trying the new passwordless login getting this
    service: new STMPService({
                     ^
    
    TypeError: STMPService is not a constructor `
    s
    r
    • 3
    • 5
  • s

    sharma

    07/19/2022, 12:02 PM
    Passwordless smtp not a constructor
  • s

    sharma

    07/19/2022, 1:30 PM
    Regarding supertokens-web-js
    supertokensEmailPassword.signUp
    , is the returned promise rejected in case of FIELD_ERROR? Initially I wrote the code inside .catch to deal with FIELD_ERROR but on debugging found that the code does not reach
    .catch
    , but it is inside
    .then
    . Is it intended?
    r
    • 2
    • 13
  • j

    Jota

    07/19/2022, 2:02 PM
    Is it possible to add like some kind of branding to the sign in and sign up? Like logo and so on?
    r
    • 2
    • 3
  • r

    rp

    07/19/2022, 2:15 PM
    Add branding to the sign in page
  • n

    nikolaiavich

    07/19/2022, 4:41 PM
    How would we exactly test a resolver in nest js with
    session: Session
    guard ?
    r
    t
    • 3
    • 24
  • r

    rp

    07/19/2022, 4:52 PM
    Testing with nestjs
  • a

    Alankazam

    07/19/2022, 5:03 PM
    Hello, is there any way to separate standard users from admin users? something like groups
    r
    • 2
    • 1
  • k

    Killian

    07/19/2022, 11:28 PM
    Hello, I am trying the new roles with React Native and Expo. I am trying to set the roles to the "accessTokenPayload", but it returns an empty an object when I try and access it on the frontend. Server:
    javascript
     Session.init({
          override: {
            functions: (originalImplementation) => {
              return {
                ...originalImplementation,
                createNewSession: async function (input) {
                  let userId = input.userId;
    
                  let roles = await UserRoles.getRolesForUser(userId);
    
                  input.accessTokenPayload = {
                    ...input.accessTokenPayload,
                    roles,
                  };
    
                  return originalImplementation.createNewSession(input);
                },
              };
            },
          },
        }),
    Frontend:
    javascript
    import SuperTokens from "supertokens-react-native";
    
    import useAppStore from "../zustand/auth-store";
    
    async function checkForSession() {
      if (await SuperTokens.doesSessionExist()) {
        const userId = await SuperTokens.getUserId();
        console.log("UserId: " + userId);
    
        const roles = await SuperTokens.getAccessTokenPayloadSecurely();
    
        console.log(roles);
    
        useAppStore.setState({
          isAuthenticated: true,
          userId: userId,
        });
      } else {
        useAppStore.setState({
          isAuthenticated: false,
          userId: null,
        });
      }
    }
    
    export default checkForSession;
    Output:
    javascript
    UserId: 8cba27de-db0c-43ea-9d76-0ac6a44d7a38
    UserId: 8cba27de-db0c-43ea-9d76-0ac6a44d7a38
    Object {}
    Object {}
    Object in this case is the output of
    javascript
    console.log(roles);
  • k

    Killian

    07/19/2022, 11:40 PM
    The user should also have a role because when I output all users with the "pending" role, the userId comes up
    javascript
    async function getUsersThatHaveRole(role: string) {
      const response = await UserRoles.getUsersThatHaveRole(role);
    
      console.log(response);
    
      if (response.status === "UNKNOWN_ROLE_ERROR") {
        // No such role exists
        return;
      }
    
      const users: string[] = response.users;
    }
    javascript
    {
      users: [
        '8cba27de-db0c-43ea-9d76-0ac6a44d7a38',
        '1aac8fa3-5a95-4016-902f-1613d8e339cb'
      ],
      status: 'OK'
    }
  • k

    Killian

    07/19/2022, 11:49 PM
    Nevermind, I find out what it was. All I had to do was log out and log back in. Which makes sense 🤦‍♂️
  • s

    showtim3

    07/20/2022, 7:17 AM
    Hey @rp Need your help with something. So we use AWS apmplify to deploy and preview our frontend build and it has different URL's for different PR's of the type(https://pr-number.xyz.amplifyapp.com), so with supertokens we are unable to get the PR previews to work.(Since i guess we need to provide the website url to the backend SDK at the time of initialization) Any thoughts on this?
    r
    h
    • 3
    • 26
  • a

    Abhishek | TechVZero

    07/20/2022, 8:11 AM
    Hi My team is trying to implement supertokens on Vue3, but there is no vue specific guide, is there a guide for using the supertokens-web-js for vanilla js atleast ?
    r
    • 2
    • 2
  • a

    Abhishek | TechVZero

    07/20/2022, 8:11 AM
    https://github.com/supertokens/supertokens-web-js We have not been able to find any guide for this which would atleast allow us to create our own wrapper for Vue on supertokens
    r
    • 2
    • 3
  • r

    rp

    07/21/2022, 3:39 AM
    Guide for vuejs
  • i

    IaS1506

    07/21/2022, 7:58 AM
    Hi @rp, I need to have access to one self-hosted supertokens app from multidomains.I mean that I want to use one app for authorization in different sites with similar sub-domain of second level. Are there any options to do that(maybe i can put mask of website domain to app config like .example. or something like that)?
    r
    • 2
    • 53
  • f

    FinnTheHero

    07/21/2022, 11:27 AM
    Hi @rp, do you know of any implementations for svelte? I`m trying to use the supertokens-web-sdk for svelte (sveltekit), but Im having issues with getting fetch to pass along the cookies required for the api-requests.
    r
    • 2
    • 7
  • a

    Alankazam

    07/21/2022, 3:43 PM
    Hello, I'm getting the following error message:
    {
      "error": "The middleware couldn't serve the API path /signin, method: post. If this is an unexpected behaviour, please create an issue here: https://github.com/supertokens/supertokens-node/issues"
    }
    Note¹: The /signup path works normally. Note²: I'm using the following recipes in order: Session, UserMetadata, UserRoles, PasswordLess, EmailPassword Can you tell me how I can diagnose this problem?
    r
    • 2
    • 11
  • r

    rp

    07/21/2022, 4:07 PM
    API routing issue
  • a

    Arjun

    07/21/2022, 7:29 PM
    hey everyone, maybe I missed it in the docs, but is there an sdk exposure to editing the front end interfaces for the signup/login/verify email/reset password pages?
    r
    n
    • 3
    • 6
  • j

    Jake

    07/23/2022, 2:08 AM
    Hey, when setting custom claims in the access token where is the best place to do that? Using refreshPOST override, or make it a side effect in an api call which is called by the frontend as part of the login process? I've been reading through the docs and I can see a few examples of doing it for a /login route but just struggling to understand is that overriding a login route provided ootb by supertokens or is it in addition to the normal flows?
    r
    • 2
    • 7
  • r

    rp

    07/23/2022, 3:49 AM
    Adding custom claims
Powered by Linen
Title
r

rp

07/23/2022, 3:49 AM
Adding custom claims
View count: 1