• r

    rp

    2 years ago
    however long you want. For example, if you want sessions to stay alive for 1 month (user will get logged out after 1 month of inactivity), then you have to set the
    refresh_token_validity
    value to
    43800
    (1 month in mins).
  • r

    rp

    2 years ago
    This will automatically manage the tokens on android to be valid for 1 month
  • Sun Walker

    Sun Walker

    2 years ago
    Hey @User what command should I use to create my supertokens container EDIT nevermind found all config herehttps://hub.docker.com/r/supertokens/supertokens-postgresql
  • Sun Walker

    Sun Walker

    2 years ago
    Also where is the location of the config file that you can edit?
  • Sun Walker

    Sun Walker

    2 years ago
    My licensekey says 'production'? i start my docker instance in 'dev' what does this mean?
  • Sun Walker

    Sun Walker

    2 years ago
    I keep getting this error:
    Error connecting to PostgreSQL instance. Please make sure that PostgreSQL is running and that you have specified the correct values for 'postgresql_host' and 'postgresql_port' in your config file
  • Sun Walker

    Sun Walker

    2 years ago
    I made container like this:
    docker run \
        --name supertokens_container \
        -p 3567:3567 \
        -v /Users/Stephano/Development/code/app/support/setup/arch_supertokens/config.yaml:/usr/lib/supertokens/config.yaml \
        -v 
    /Users/Stephano/Development/code/app/support/setup/arch_supertokens/licenseKey:/usr/lib/supertokens/licenseKey \
        -d supertokens/supertokens-postgresql dev
  • Sun Walker

    Sun Walker

    2 years ago
    run like this
    docker start supertokens_container
  • Sun Walker

    Sun Walker

    2 years ago
    I think I need to migrate from 1.0 to 2.0 what do i need to change?
  • Sun Walker

    Sun Walker

    2 years ago
    And this code no longer works because of revoke session
    JavaScript
    export const attemptRefreshSession = async (req: Request, res: Response) => {
      try {
        await refreshSession(req, res);
        return env !== 'development' ? true : developmentCookieResponse(res);
      } catch (err) {
        const authError = Error.isErrorFromAuth(err);
    
        if (authError && err.errType === Error.UNAUTHORISED) {
          throw createHttpError(440, {
            message: 'Unauthorized. Please Login.',
            err,
          });
        }
        if (authError && err.errType !== Error.GENERAL_ERROR) {
          const sessionHandle = err?.err?.sessionHandle;
          const successfulRevoke = await revokeSessionUsingSessionHandle(
            sessionHandle
          );
          throw createHttpError(440, {
            message: `${successfulRevoke ? 'Session Revoked. ' : ''}Please Login.`,
            err,
          });
        }
        throw createHttpError(500, { err });
      }
    };