feat: Add sld redirects
All checks were successful
Build Docker / Build Main Image (push) Successful in 39s

This commit is contained in:
Nathan Woodburn 2023-12-21 15:51:00 +11:00
parent d0985a8c1f
commit 5b4d15a544
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -52,6 +52,13 @@ def error(message):
@app.route('/') @app.route('/')
def index(): def index():
# Check if domain is subdomain
if request.host.count('.') > 1:
# See if link exists
link = db.get_link(request.host.split('.')[0])
if link != False:
return redirect(link)
if 'linkr' in request.cookies: if 'linkr' in request.cookies:
token = request.cookies['linkr'] token = request.cookies['linkr']
domain = account.get_user(token) domain = account.get_user(token)