• ClumsyPenguin

    ClumsyPenguin

    4 months ago
    Hi just joined. I got a quick questions. Do you guys offer an .NET SDK ? And if not how serious are you guys in for building one ?
  • r

    rp

    4 months ago
    Hey @ClumsyPenguin we don’t have support for .NET yet. We will probably build one sometime next year.
  • LouieMartin

    LouieMartin

    4 months ago
    Can I Sign up a user with like a function that takes parameters for username, password, email, ect... ex:
    ts
    signUp({
      username: 'LouieMartin',
      password: '123123',
    });
    LouieMartin
    r
    20 replies
    Copy to Clipboard
  • aV

    aV

    4 months ago
    @rp Is ULID supported for user ids?
    aV
    r
    8 replies
    Copy to Clipboard
  • execreate

    execreate

    3 months ago
    Hey guys, It looks like there might be a sneaky bug in the
    verify_session()
    wrapper in
    supertokens-python@dev-v0.8.2
    . I am using
    Django==4.0
    and djangorestframework==3.13.1:
    python
    from django.utils.decorators import method_decorator
    from rest_framework import viewsets, mixins, status
    from supertokens_python.recipe.session.framework.django.syncio import verify_session
    
    
    @method_decorator(verify_session(), name='dispatch')
    class WorkplaceCreateListViewSet(mixins.ListModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet):
        def create(self, request, *args, **kwargs):
            return super().create(request, *args, **kwargs)
    execreate
    r
    65 replies
    Copy to Clipboard
  • execreate

    execreate

    3 months ago
    Hey guys, How can I get last login date for the user? I am using
    supertokens_python
    , Django framework
    execreate
    r
    2 replies
    Copy to Clipboard
  • Demna

    Demna

    3 months ago
    I'm trying to follow the AWS Lambda recipe, but to no success. I'm sure there are several things broken in my code, but first and foremost, for some reason, my
    auth.js
    and
    user.js
    can't find
    middy
    , though it's installed.
    auth.js
    js
    import supertokens from "supertokens-node";
    // I had to specify "index.js" at the end or else it complained.
    import { middleware } from "supertokens-node/framework/awsLambda/index.js";
    import { getBackendConfig } from "./config.js";
    import middy from "@middy/core";
    import cors from "@middy/http-cors";
    
    supertokens.init(getBackendConfig());
    
    module.exports.handler = middy(middleware()).use(cors({
        origin: getBackendConfig().appInfo.websiteDomain,
        credentials: true,
        headers: ["Content-Type", ...supertokens.getAllCORSHeaders()].join(", "),
        methods: "OPTIONS,POST,GET,PUT,DELETE"
    })).onError(request => {
        throw request.error;
    });
    user.js
    js
    let supertokens = require("supertokens-node");
    let { verifySession } = require("supertokens-node/recipe/session/framework/awsLambda");
    let middy = require("@middy/core");
    let cors = require("@middy/http-cors");
    let { getBackendConfig } = require("./config");
    
    supertokens.init(getBackendConfig());
    
    const handler = async (event, _) => {
        return {
            statusCode: 200,
            headers: {
                "content-type": "application/json",
            },
            body: JSON.stringify({
                sessionHandle: event.session.getHandle(),
                userId: event.session.getUserId(),
                accessTokenPayload: event.session.getAccessTokenPayload(),
            }),
        };
    };
    
    module.exports.handler = middy(verifySession(handler))
        .use(
            cors({
                origin: getBackendConfig().appInfo.websiteDomain,
                credentials: true,
                headers: ["Content-Type", ...supertokens.getAllCORSHeaders()].join(", "),
                methods: "OPTIONS,POST,GET,PUT,DELETE",
            })
        )
        .onError((request) => {
            throw request.error;
        });
  • Demna

    Demna

    3 months ago
    package.json
    json
    {
      "name": "server-lambda",
      "type": "module",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "keywords": [],
      "author": "",
      "license": "ISC",
      "dependencies": {
        "middy": "^0.36.0",
        "supertokens-node": "^9.2.2"
      }
    }
  • Demna

    Demna

    3 months ago
    And when I test it:
    sh
    $ node auth.js
    node:internal/errors:466
        ErrorCaptureStackTrace(err);
        ^
    
    Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@middy/core' imported from /home/dsaghliani/Projects/supertokens-demo/server-lambda/auth.js
        at new NodeError (node:internal/errors:377:5)
        at packageResolve (node:internal/modules/esm/resolve:910:9)
        at moduleResolve (node:internal/modules/esm/resolve:959:20)
        at defaultResolve (node:internal/modules/esm/resolve:1174:11)
        at ESMLoader.resolve (node:internal/modules/esm/loader:605:30)
        at ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:18)
        at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
        at link (node:internal/modules/esm/module_job:78:36) {
      code: 'ERR_MODULE_NOT_FOUND'
    }
    
    Node.js v18.2.0
    Demna
    r
    4 replies
    Copy to Clipboard
  • Demna

    Demna

    3 months ago
    Where did I go wrong?