fix auth clearing error

This commit is contained in:
Ali Abid 2021-10-18 18:34:28 +00:00
parent e6c982250e
commit d1f124c6e4
2 changed files with 11 additions and 1 deletions

11
demo/hello_world_test.py Normal file
View File

@ -0,0 +1,11 @@
import gradio as gr
from random import choice
def greet(name):
return "Hello " + name + "!!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
u, p = choice("qwerty"), choice("asdf")
print(u, p)
if __name__ == "__main__":
iface.launch(auth=(u,p), share=True)

View File

@ -127,7 +127,6 @@ def get_first_available_port(initial, final):
@app.route("/", methods=["GET"])
@login_check
def main():
session.clear()
session["state"] = None
return render_template("index.html", config=app.interface.config)