diff --git a/main.py b/main.py index e379889..8cbf0ff 100644 --- a/main.py +++ b/main.py @@ -81,7 +81,6 @@ def login(): @app.route('/edit') def edit(): - if 'token' not in request.cookies: return redirect('/') @@ -152,11 +151,22 @@ def logout(): resp.set_cookie('token', '', expires=0) return resp +@app.route('/claim') +def claim(): + # Find domain + domain = request.args.get('domain') + return redirect('/signup?domain=' + domain) + + + @app.route('/') def catch_all(path): account = "Login" account_link = "login" site = "Null" + domain = "" + if 'domain' in request.args: + domain = request.args.get('domain') if 'token' in request.cookies: token = request.cookies['token'] # Verify token @@ -174,11 +184,11 @@ def catch_all(path): # If file exists, load it if os.path.isfile('templates/' + path): - return render_template(path,account=account,account_link=account_link,site=site,CITY_DOMAIN=CITY_DOMAIN) + return render_template(path,account=account,account_link=account_link,site=site,CITY_DOMAIN=CITY_DOMAIN,domain=domain) # Try with .html if os.path.isfile('templates/' + path + '.html'): - return render_template(path + '.html',account=account,account_link=account_link,site=site,CITY_DOMAIN=CITY_DOMAIN) + return render_template(path + '.html',account=account,account_link=account_link,site=site,CITY_DOMAIN=CITY_DOMAIN,domain=domain) return redirect('/') # 404 catch all # 404 catch all diff --git a/templates/signup.html b/templates/signup.html index d764170..fce98ec 100644 --- a/templates/signup.html +++ b/templates/signup.html @@ -31,7 +31,7 @@

Sign up for your free page

-

.{{CITY_DOMAIN}}

+

.{{CITY_DOMAIN}}