Skip to content

Commit 23314e9

Browse files
committed
fixes example of flask
1 parent b75b6ab commit 23314e9

File tree

1 file changed

+5
-5
lines changed
  • examples/with-flask/with-thirdpartyemailpassword

1 file changed

+5
-5
lines changed

examples/with-flask/with-thirdpartyemailpassword/app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22

33
from dotenv import load_dotenv
4-
from flask import Flask, g, jsonify
4+
from flask import Flask, abort, g, jsonify
55
from flask_cors import CORS
66
from supertokens_python import (InputAppInfo, SupertokensConfig,
77
get_all_cors_headers, init)
@@ -105,10 +105,10 @@ def get_session_info():
105105

106106
# This is required since if this is not there, then OPTIONS requests for
107107
# the APIs exposed by the supertokens' Middleware will return a 404
108-
@app.route("/", defaults={"path": ""}) # type: ignore
109-
@app.route("/<path:path>") # type: ignore
110-
def index(_: str):
111-
return ''
108+
@app.route('/', defaults={'u_path': ''}) # type: ignore
109+
@app.route('/<path:u_path>') # type: ignore
110+
def catch_all(u_path: str): # pylint: disable=unused-argument
111+
abort(404)
112112

113113

114114
if __name__ == '__main__':

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy