Skip to content
Snippets Groups Projects
Commit 5f9c3f16 authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

added state checking

parent 700d71e3
No related branches found
No related tags found
No related merge requests found
Pipeline #5793 failed with stage
......@@ -34,6 +34,8 @@ def create_app(config_name):
@app.route('/', methods=['GET', 'POST']) # initial route to display the reg page
def index():
invalid_state = ["blocked", "certification"]
if 'uid' not in session:
session['uid']=str(uuid.uuid4())
......@@ -48,7 +50,11 @@ def create_app(config_name):
else:
session['return_url'] = request.referrer
return render_template('auth/SignUp.html', room_id=session['uid'],
if rc_util.check_state(session['user'].get('username')) in invalid_state:
return render_template('errors/error.html', title='account creation failed')
else:
return render_template('auth/SignUp.html', room_id=session['uid'],
username=session['user'].get('username'),
fullname=session['user'].get('fullname'), email=session['user'].get('email'),
referrer=session['return_url'], cancel_url=vars.default_referrer,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment