Files
replit-py/examples/web/needs_sign_in.py
2021-01-06 21:48:28 -05:00

21 lines
339 B
Python

from replit import web
app = web.App(__name__)
@app.route("/")
@web.needs_sign_in(login_res=f"Hello! {web.sign_in_snippet}")
def index():
return "Index function"
# needs_signin can also be called with no args
@app.route("/test")
@web.needs_sign_in
def test():
return "Test function"
if __name__ == "__main__":
app.run()