Hi, i’m new to SuperTokens and I'm liking it quite...
# support-questions-legacy
r
Hi, i’m new to SuperTokens and I'm liking it quite a lot. I've tried to setup a simple app just to test it out but I've run into a problem. I have read through the documentation, searched on google, asked ai, be ut I was not ablto find a solution to my problem. I’m using Flask without any dedicated frontend - the flask app directly renders the HTML pages. And what I need is a way to completely handle the login (and all the other supertokens logic) by the backend (no JS on the frontend), the login page is just a simple form that sends a html form data to the backend and returns page that show the user info. Something like this (this is very very simplified, but it gives you the basic premise):
Copy code
@app.route(“/login”, methods=[“GET”, “POST”]
def page_login():
    if request.method != “POST”:
        return “””
            <form method=“POST” action=“/login”>
                <input type=“email” name=“email” id="email">
                <input type=“password” name=“password” id="password">
                <button type=“submit”>Login</button>
            </form>
        “””

        else:
              user = supertokens.do_login_logic(request.form[“email”], request.form[“password”]) # Plus it sets up all the session stuff, etc.

             return f”UserID = {user.get_user_info()['userId']}”
I basically need to do the signup, login,... logic the middleware(app) does, but handling the requests/endpoints myself. Is something like that possible? Any help would be appreciated.
6 Views