forked from platypush/platypush
Added backend /login
and /register
routes.
These are required for clients that don't have JS enabled and will get a 404 otherwise. The routes simply render `index.html`, which will be empty if JS is disabled and will redirect to the appropriate login/registration Vue route if the user isn't logged in.
This commit is contained in:
parent
ccc778e056
commit
6053a80796
1 changed files with 20 additions and 2 deletions
|
@ -14,8 +14,26 @@ __routes__ = [
|
||||||
|
|
||||||
@index.route('/')
|
@index.route('/')
|
||||||
@authenticate()
|
@authenticate()
|
||||||
def index():
|
def index_route():
|
||||||
""" Route to the main web panel """
|
"""Route to the main web panel"""
|
||||||
|
return render_template('index.html', utils=HttpUtils)
|
||||||
|
|
||||||
|
|
||||||
|
@index.route('/login', methods=['GET'])
|
||||||
|
def login_route():
|
||||||
|
"""
|
||||||
|
Login GET route. It simply renders the index template, which will
|
||||||
|
redirect to the login page if the user is not authenticated.
|
||||||
|
"""
|
||||||
|
return render_template('index.html', utils=HttpUtils)
|
||||||
|
|
||||||
|
|
||||||
|
@index.route('/register', methods=['GET'])
|
||||||
|
def register_route():
|
||||||
|
"""
|
||||||
|
Register GET route. It simply renders the index template, which will
|
||||||
|
redirect to the registration page if no users are present.
|
||||||
|
"""
|
||||||
return render_template('index.html', utils=HttpUtils)
|
return render_template('index.html', utils=HttpUtils)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue