https://supertokens.com/
Join Discord
Hey there, <@498057949541826571> I'm currently integrating social authentication (google) into my ...
a

ashutoshdeshmukh.22

over 1 year ago
Hey there, @rp_st I'm currently integrating social authentication (google) into my application via SuperTokens. I'm looking to retrieve additional user details such as first name, last name, and gender from the social authentication process. However, it seems that these details are not being populated in the user data. as these are basic user details that must provided by google or any other social auth. Could you please let me know if there's any extra configuration required in the SuperTokens config to fetch these details, or if it's outside the scope of SuperTokens?
a
r
s
  • 3
  • 51
  • 24
Hello, I am trying to break my overrides out to be more modular, but I am having trouble typing them...
b

bolg55

almost 2 years ago
Hello, I am trying to break my overrides out to be more modular, but I am having trouble typing them.
ts
import { db } from '@db/index';
import { users, profiles } from '@db/schema';

const thirdPartySignInUpOverride =
  (originalImplementation) => async (input) => {
    let response = await originalImplementation.thirdPartySignInUp(input);

    if (response.status === 'OK') {
      let { id, emails } = response.user;
      console.log('USER SIGNED UP', id);
      await db.transaction(async (trx) => {
        await trx.insert(users).values({
          id,
          email: emails[0],
        });
        await trx.insert(profiles).values({
          userId: id,
        });
      });

      // This is the response from the OAuth 2 provider that contains their tokens or user info.
      let providerAccessToken = response.oAuthTokens['access_token'];
      let firstName =
        response.rawUserInfoFromProvider.fromUserInfoAPI!['first_name'];

      if (
        response.createdNewRecipeUser &&
        response.user.loginMethods.length === 1
      ) {
        // TODO: Post sign up logic
      } else {
        // TODO: Post sign in logic
      }
    }
    return response;
  };

export default thirdPartySignInUpOverride;
I am really not sure of what the
originalImplementation
type should be. I have tried creating an interface from ThirdPartyPasswordless recipe, but that didn't work at all. Any ideas? Edit: Found a way to type using RecipeInterface. Not sure if this is documented? I had to search in discord and got lucky
b
r
  • 2
  • 1
  • 24
Hi, is the types for the default translations from the recipes in supertokens-auth-react exported?
u

.algor1thm

almost 2 years ago
Hi, is the types for the default translations from the recipes in supertokens-auth-react exported?
u
r
  • 2
  • 5
  • 24
Hi, I have downloaded and installed npx create-supertokens-app@latest which is working ok when i'm u...
j

joey_15135

almost 2 years ago
Hi, I have downloaded and installed npx create-supertokens-app@latest which is working ok when i'm using connectionURI: "https://try.supertokens.com" how ever to do some further testing I have also installed supertokens core locally using this guide https://supertokens.com/docs/session/quick-setup/core/without-docker which is also working ok (localhost:3567 is returning 'hello'). However, when i set the connectionURI:"http://localhost:3567" and try to do signup from the front end I'm getting an error "No SuperTokens core available to query"
j
r
  • 2
  • 2
  • 24
I am running NextJS with an Express API on a separate server. Is there a way for me to get the user ...
r

robottonyc

about 2 years ago
I am running NextJS with an Express API on a separate server. Is there a way for me to get the user session inside getServerSideProps in my NextJS application? I have tried following the NextJS specific directions for getServerSideProps but it always comes back unauthorized. Any advice? I'm thinking I need to use the SDK inside getServerSideProps which is fine but how do I get the user id or session id so I can check if they have a valid session? My goal is to redirect to a different page if the user is authenticated. My api is running on api.example.com and app on app.example.com on my localhost by adjusting my etc/hosts. I get a session on first page load after logging in, if I refresh the page then it fails with the UNAUTHORIZED error triggering an infinite refreshing loop.
r
r
  • 2
  • 37
  • 24
I have a solution that is a mono-repo using Lerna v7 and npm v8. It is using `supertokens-node`. `no...
u

umarfkhawaja

about 2 years ago
I have a solution that is a mono-repo using Lerna v7 and npm v8. It is using
supertokens-node
.
node_modules
are being hoisted to the root of the repository. Till I was using
v14
of
supertokens-node
, it was being hoisted to the root correctly. There was only one copy of the library. Everything was fine. Since I have upgraded to
v15
though, I have noticed that there is a separate copy of
supertokens-node
in each package where it is being used. Consequently, I am getting the following error on startup.
Error: Please call the supertokens.init function before using SuperTokens
How do I rectify this?
u
r
  • 2
  • 14
  • 24
Why am I getting this axios error when sending request to the api. Just to clear things off, I have ...
y

youscript

about 2 years ago
Why am I getting this axios error when sending request to the api. Just to clear things off, I have not protected this api route or sending this 401 status from my api route.
y
r
  • 2
  • 3
  • 24
Hi, I’m using Mailjet as a mail platform and would like to send supertokens mails using the service....
d

dominikjohn.

about 2 years ago
Hi, I’m using Mailjet as a mail platform and would like to send supertokens mails using the service. In the SMTP docs, I can only finds fields for providing a username / password. However, Mailjet only provides me with an API key and secret for the SMTP instead of credentials. Is there a way to configure Mailjet for use with Supertokens anyway?
d
r
  • 2
  • 1
  • 24
<@498057949541826571> is it possible to delete all users and their data programmatically.
a

aV

over 2 years ago
@rp_st is it possible to delete all users and their data programmatically.
a
r
d
  • 3
  • 17
  • 24
<@498057949541826571> There is a problem with the frontend. If I clear the st-last-access-token-upda...
i

ikak1595

over 2 years ago
@rp_st There is a problem with the frontend. If I clear the st-last-access-token-update cookie and then try to login/signup, supertokens' backend will start giving error. Even after reloading the page, it won't work. It happened with me earlier also but that was because I was using * in cors , but now that is not the case. My backend supertokens-python version is 0.12.6, in the frontend the versions are: "supertokens-auth-react": "^0.31.1", "supertokens-node": "^13.0.2", "supertokens-web-js": "^0.5.0",
i
r
  • 2
  • 12
  • 24
Previous535455Next

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