• b

    Bosky

    1 year ago
    i had to add the catch
  • r

    rp

    1 year ago
    if you are using await, you can surround with try and catch
  • b

    Bosky

    1 year ago
    ok this seems better
    let session = await supertokens.getSession(req, res, true).catch(er => null);
        if(!session){ return redirect(); }
  • r

    rp

    1 year ago
    try {
      let session = await supertokens.getSession(req, res, true)
    } catch (err) {
     if (err.errType === supertokens.Error.UNAUTHORISED) {
        redirect
      }
    }
  • r

    rp

    1 year ago
    @User , most of the queries you have can be answered via the node js docs: https://supertokens.io/docs/nodejs/usage-with-express/user-login
  • b

    Bosky

    1 year ago
    am getting this error today, right after init
    Error: No SuperTokens core available to query
  • r

    rp

    1 year ago
    Can you please send your init code?
  • r

    rp

    1 year ago
    cause your server is working
  • nxteword

    nxteword

    1 year ago
    Hey rp, can I use supertokens with next framework hosted on vercel serverless functions and mongodb database?
  • r

    rp

    1 year ago
    Hey @nxteword do you want to use the login feature or just session management?