• nadilas

    nadilas

    5 months ago
    Hey guys, I had a question two days back and wanted to share the solution here: I needed a way to generate a separate jwt token for a third party service given a specific signing key. Problem statement: I wanted to patch it in via the
    Session.init({apis.refreshPOST})
    override, but the session was not available in the response. Solution was given by @rp to use a funtion override instead:
    override: {
              functions: originalImplementation => ({
                ...originalImplementation,
                refreshSession: async (input) => {
                  const session = await originalImplementation.refreshSession(input)
                  await addJWTTokenToTokenPayload(session)
                  return session
                },
                createNewSession: async (input) => {
                  const session = await originalImplementation.createNewSession(input)
                  await addJWTTokenToTokenPayload(session)
                  return session
                }
              })
            }
  • CuriousCI

    CuriousCI

    5 months ago
    Hey guys! Does anyone have a supertokens + django project on GitHub, so I can check the code? Thanks! Also, if I wanted to implement supertokens frontend for Svelte, where should I propose the feature?
  • r

    rp

    5 months ago
    @CuriousCI if you upload your code on github, we can proof check it.. there isn't an example for it yet 😦
  • CuriousCI

    CuriousCI

    5 months ago
    Got it. I can't show you the whole code, as it's a private project for a client, but I can ask you about my main issues: First of all, in the documentation it says to
    Add the code below to your server's init file.
    , but I'm not sure which **init **file to use: the project's __init__.py? The app's __init__.py? Another file I haven't considered? My next question, is the app_info fields, I'm not sure enough about some fields' meaning:
    app_name='', # A generic name, the name of my Django app or the name of my Django project?
    api_domain='http://localhost:8000', # I understood this one.
    website_domain='https://localhost:3000', # I understood this one too.
    api_base_path='/api', # Is this the path of the Django application?
    website_base_path='/' # I don't get this one at all... Mind you, I haven't set up the front-end yet, but I've read the documentation about it.
    CuriousCI
    r
    25 replies
    Copy to Clipboard
  • BeeMoe

    BeeMoe

    5 months ago
    how to install the python backend with pip?
    BeeMoe
    r
    5 replies
    Copy to Clipboard
  • r

    rp

    5 months ago
    installing python SDK
  • g

    Gav

    5 months ago
    Hi! Is it possible to either specify a user ID during creation (I use passwordless), or update the ID at a later date? I've seen user-mapping as a technique, but it would be awesome to have more granular control. Just wondering, thanks!
    g
    r
    10 replies
    Copy to Clipboard
  • MacZZi

    MacZZi

    5 months ago
    hi folks, I'm a bit confused by supertokens usage and can use some help to clarify my concepts. so, I'm using managed service to store user session and password info but how can I create a copy of this user in my own database? do we get any callback or something with supertokens id?
    MacZZi
    r
    4 replies
    Copy to Clipboard
  • 24kMagic

    24kMagic

    4 months ago
    Hi team, I'm actually facing a problem.. I have a postgres instance running on a seperate container, and I want to connect supertokens container to the postgres container. I think I am facing issue at POSTGRESQL_HOST.. This is my docker command: sudo docker run -p 3567:3567 -e POSTGRESQL_USER="postgres" -e POSTGRESQL_PASSWORD="postgres" -e POSTGRESQL_HOST="host" -e POSTGRESQL_PORT="5432" -e POSTGRESQL_DATABASE_NAME="supertokens" -d registry.supertokens.io/supertokens/supertokens-postgresql This is my postgres docker-compose.yml: version: '3' services: db: image: postgres:latest environment: POSTGRES_USER: user POSTGRES_PASSWORD: pass POSTGRES_DB: supertokens ports: - 5432:5432 networks: - db restart: unless-stopped supertokens: image: registry.supertokens.io/supertokens/supertokens-postgresql depends_on: - db ports: - 3567:3567 environment: POSTGRESQL_CONNECTION_URI : postgresql😕/user😛ass@db/supertokens networks: - db restart: unless-stopped networks: db: driver: bridge
    24kMagic
    r
    +1
    10 replies
    Copy to Clipboard
  • r

    rp

    4 months ago
    Docker issue