realms-wiki/realms/modules/auth/__init__.py
Matthew Scragg 0b1c55f6a5 fallback to default avatar if email is not set
auth submodules are registered with initialized
check if auth.local is loaded before accessing registration route
check DB_URI before attempt to create db
2015-11-06 17:44:48 -06:00

14 lines
417 B
Python

from realms import login_manager
from flask import request, flash, redirect
from flask.ext.login import login_url
modules = set()
@login_manager.unauthorized_handler
def unauthorized():
if request.method == 'GET':
flash('Please log in to access this page')
return redirect(login_url('auth.login', request.url))
else:
return dict(error=True, message="Please log in for access."), 403