mirror of
https://github.com/kennethreitz/replit-py.git
synced 2026-06-05 23:10:18 +00:00
Add code to needs_signin example
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from replit import maqpy
|
||||
|
||||
app = maqpy.App(__name__)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
@needs_signin(login_html=f"Hello! {maqpy.sign_in_snippet}")
|
||||
def index():
|
||||
return "Index function"
|
||||
|
||||
|
||||
# needs_signin can also be called with no args
|
||||
@app.route("/test")
|
||||
@needs_signin
|
||||
def test():
|
||||
return "Test function"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
|
||||
Reference in New Issue
Block a user