2014-10-31 00:59:19 +02:00
|
|
|
from realms import login_manager
|
|
|
|
from flask import request, flash, redirect
|
|
|
|
from flask.ext.login import login_url
|
|
|
|
|
2015-11-07 01:44:48 +02:00
|
|
|
modules = set()
|
2014-10-31 00:59:19 +02:00
|
|
|
|
|
|
|
@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
|