https://supertokens.com/
Join Discord
Hello, I'm using FastAPI and my goal is to implements by myself the route /auth/signup because I wan...
a

Arti

over 2 years ago
Hello, I'm using FastAPI and my goal is to implements by myself the route /auth/signup because I want it to be visible on the open-api swagger. Currently I don't have a front-end, so I'm only using the swagger. I'm struggling with get_session and create_new_session. After I log-in, get_session always returns None.
py
class UserRegisterModel(BaseModel):
    email: str
    password: str


@router.post('/register')
async def register_user(
    request: Request,
    user: UserRegisterModel,
):
    email_password_quertier = Querier.get_instance('emailpassword')
    path = NormalisedURLPath('/recipe/signup')
    response = await email_password_quertier.send_post_request(path, user.dict())
    if response.get('status') == 'OK':
        user_id = response['user']['id']
        session = await create_new_session(
            request,
            user_id
        )
        return True
    raise Exception('user exists')

@router.post('/like_comment') 
async def like_comment(request: Request):
    session = await get_session(request, session_required=False)

    if session is None:
        raise Exception("Should never come here")
    user_id = session.get_user_id()

    print(user_id)
a
r
  • 2
  • 17
  • 27
Hey, got a question regarding axios interceptors. Since we no longer need to explicitly set intercep...
l

leandergan

almost 3 years ago
Hey, got a question regarding axios interceptors. Since we no longer need to explicitly set interceptors, how can I choose which axios instance the supertokens chould use? (is that possible) (using vue3 and go)
l
r
p
  • 3
  • 15
  • 27
If we use the supertokens connection uri, we wouldn't be able to modify the database to create new t...
c

chunkygoo.

about 3 years ago
If we use the supertokens connection uri, we wouldn't be able to modify the database to create new tables etc. This means that I have to "copy" the user id and email to my app's database, resulting in redundant information and possibly out of sync. What is the recommended action here? Why wouldn't ST let us have the db connection for prod just like for dev?
c
r
  • 2
  • 10
  • 27
Let's say I have two customers, C1 and C2, and we provide some integrations infrastructure to them w...
a

abhisheksachdeva

about 3 years ago
Let's say I have two customers, C1 and C2, and we provide some integrations infrastructure to them where Auth is powered by Supertokens (self-hosted for development purposes). Both customers have a common user, U1. If the user signs in to their products P1 and P2 using google, supertokens will assume that it is the same user as
third_party_user_id
is the same but will create two
sessions
. This might lead to some issues in the future as we will be using user_id for lots of other stuff. 1. Is there any way to consider them as separate users? 2. Should we use separate supertokens instance (cloud or local) for each customer? I guess, you will have something internally to manage multiple clients on the supertokens cloud.
a
r
  • 2
  • 11
  • 27
Hi, is there any example of how can I use Facebook provider in react native ?
b

binouse

about 3 years ago
Hi, is there any example of how can I use Facebook provider in react native ?
b
r
n
  • 3
  • 13
  • 27
Hi. How can I catch errors in SuperTokens.init on the frontend. Assuming I get a 500 Internal Server...
a

alfreddohnani

about 3 years ago
Hi. How can I catch errors in SuperTokens.init on the frontend. Assuming I get a 500 Internal Server Error because the supertokens core server cannot be reached
a
r
  • 2
  • 13
  • 27
My stack: Next.js frontend Nest.js backend Postgres 1. Getting Next.js to work with SuperTokens se...
j

joel04425

about 3 years ago
My stack: Next.js frontend Nest.js backend Postgres 1. Getting Next.js to work with SuperTokens seems easy. However, once the user has logged into the Next.js app and starts making API calls, how does the Nest.js app know if the user has logged in from the API calls? 2. I'd like to store user details such as email, auth provider, etc. on my own Postgres database. Is there some kind of callback that will send a request to my API when the user changes email or a new account has just been created?
j
r
  • 2
  • 12
  • 27
hey :). we are having an issue with the redirect uri returned for Apple on the web. the code that c...
c

cg.vols

over 3 years ago
hey :). we are having an issue with the redirect uri returned for Apple on the web. the code that creates the redirect uri uses the API base path instead of the UI base path.
c
r
  • 2
  • 26
  • 27
hi, i faced an issue. `Error: SuperTokens core threw an error for a POST request to path: '/recipe/a...
t

tomita0022

over 1 year ago
hi, i faced an issue.
Error: SuperTokens core threw an error for a POST request to path: '/recipe/accountlinking/user/primary' with status code: 402 and message: Account linking feature is not enabled for this app. Please contact support to enable it.
t
r
  • 2
  • 4
  • 26
I want to override the SessionAuth's behaviour of checking if the session is present or not and if n...
s

Sekai

over 1 year ago
I want to override the SessionAuth's behaviour of checking if the session is present or not and if not redirect to login page. I know I need to modify the overrideGlobalClaimValidators field but I am having troubles finding documentation on it. I don't know what exactly to put. All I know is the authorization part where it checks the roles.
s
r
  • 2
  • 6
  • 26
Previous394041Next

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