Skip to content

Instantly share code, notes, and snippets.

@Kd-Here

Kd-Here/auth.py Secret

Created March 4, 2023 15:41
Show Gist options
  • Save Kd-Here/6510508c3cd96a339cfdc2423949188a to your computer and use it in GitHub Desktop.
Save Kd-Here/6510508c3cd96a339cfdc2423949188a to your computer and use it in GitHub Desktop.
from flask import Blueprint,render_template,request
auth = Blueprint('auth',__name__)
@auth.route('/login',methods=['GET','POST'])
def login():
data = request.form
print(data)
return render_template('login.html',data_from_backend='testing data from backend')
@auth.route('/sign-up',methods=['GET','POST'])
def singin():
if request.method == "POST":
email = request.form.get('email')
firstName = request.form.get('firstName')
password1 = request.form.get('password1')
password2 = request.form.get('password2')
if len(email) < 4:
pass
elif len(firstName) < 2:
pass
elif password1 != password2:
pass
elif len(password1) < 7:
pass
else:
# add to datbase
pass
else:
return render_template('sign_up.html')
@auth.route('/logout')
def logout():
return "<h2>Logout</h2>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment