mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Add authentication and the basis of the browser module.
A user authentication module based on flask-security is added, which allows users to login and change/recover passwords etc. Custom templates are included for the user/password UIs. A new setup script will initialise the user (and later settings) DB, adding the first user and granting them an Administrator role. A redirects blueprint module is added to handle simple URL redirects. A browser module is added and currently renders a skeleton page with a menu bar, gravatar and jumbotron. NOTE FOR LATER: Currently this code might make the nice basis for any web app that needs user management and plugins. Hmmm....
This commit is contained in:
0
web/pgadmin/redirects/__init__.py
Normal file
0
web/pgadmin/redirects/__init__.py
Normal file
24
web/pgadmin/redirects/views.py
Normal file
24
web/pgadmin/redirects/views.py
Normal file
@@ -0,0 +1,24 @@
|
||||
##########################################################################
|
||||
#
|
||||
# pgAdmin 4 - PostgreSQL Tools
|
||||
#
|
||||
# Copyright (C) 2013 - 2014, The pgAdmin Development Team
|
||||
# This software is released under the PostgreSQL Licence
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
"""A blueprint module providing URL redirects."""
|
||||
MODULE_NAME = 'redirects'
|
||||
|
||||
import config
|
||||
from flask import Blueprint, redirect, url_for
|
||||
from flask.ext.security import login_required
|
||||
|
||||
# Initialise the module
|
||||
blueprint = Blueprint(MODULE_NAME, __name__)
|
||||
|
||||
@blueprint.route('/')
|
||||
@login_required
|
||||
def index():
|
||||
"""Redirect users hitting the root to the browser"""
|
||||
return redirect(url_for('browser.index'))
|
||||
Reference in New Issue
Block a user