Exemple #1
0
    def middleware(self, app):
        if is_html(app):
            cfg = app.config

            if cfg['LOGIN_URL']:
                yield Login(cfg['LOGIN_URL'])
                if cfg['LOGOUT_URL']:
                    yield Logout(cfg['LOGOUT_URL'])
                if cfg['HTML_AUTH_TOKEN_URL']:
                    yield Token(cfg['HTML_AUTH_TOKEN_URL'])

            if cfg['REGISTER_URL']:
                yield SignUp(cfg['REGISTER_URL'])

            if cfg['RESET_PASSWORD_URL']:
                yield ForgotPassword(cfg['RESET_PASSWORD_URL'])
Exemple #2
0
    def middleware(self, app):
        if is_html(app):
            cfg = app.config

            if cfg['LOGIN_URL']:
                yield Login(cfg['LOGIN_URL'])
                if cfg['LOGOUT_URL']:
                    yield Logout(cfg['LOGOUT_URL'])
                if cfg['HTML_AUTH_TOKEN_URL']:
                    yield Token(cfg['HTML_AUTH_TOKEN_URL'])

            if cfg['REGISTER_URL']:
                yield SignUp(cfg['REGISTER_URL'])

            if cfg['RESET_PASSWORD_URL']:
                yield ForgotPassword(cfg['RESET_PASSWORD_URL'])
Exemple #3
0
 def middleware(self, app):
     # user and organisation plugins in Html mode
     if is_html(app) and has_plugin(app, 'users'):
         orgs = has_plugin(app, 'organisations')
         yield UserSettings('/settings')
         yield UserView(orgs)
Exemple #4
0
 def middleware(self, app):
     # user and organisation plugins in Html mode
     if is_html(app) and has_plugin(app, 'users'):
         orgs = has_plugin(app, 'organisations')
         yield UserSettings('/settings')
         yield UserView(orgs)