Example #1
0
def auth_callback():
    """
    http://localhost/?code=ANdNAVhyhqirUelHGEHA&scope=clouddrive%3Aread_all+clouddrive%3Awrite
    """
    db.get()._p_jar.sync()
    code = f.request.args.get('code')
    auth_callback_url = utils.get_url('auth_callback', '/authcallback', True)
    configure_url = utils.get_url('configure_view', '/configure', True)
    api.authorize(code, auth_callback_url)
    return f.redirect(configure_url)
Example #2
0
def auth_callback():
    """
    http://localhost/?code=ANdNAVhyhqirUelHGEHA&scope=clouddrive%3Aread_all+clouddrive%3Awrite
    """
    db.get()._p_jar.sync()
    code = f.request.args.get('code')
    auth_callback_url = utils.get_url('auth_callback', '/authcallback', True)
    configure_url = utils.get_url('configure_view', '/configure', True)
    api.authorize(code, auth_callback_url)
    return f.redirect(configure_url)
Example #3
0
def index():
    if not api.get_credentials():
        url = utils.get_url('auth_callback', '/authcallback', True)
        return f.redirect(api.get_login_url(url))
    root = db.get()
    root._p_jar.sync()
    config = root.get('config', {})
    configured = configurator.valid(config)
    action = root.get('action', {})
    what = action.get('what')
    when = action.get('when')
    current = root.get('current_file')
    return f.render_template(
        'index.html', configured=configured, what=what,
        when=when, current_file=dict(current),
        errored=root.get('errored', [])[-20:], **config)
Example #4
0
def index():
    if not api.get_credentials():
        url = utils.get_url('auth_callback', '/authcallback', True)
        return f.redirect(api.get_login_url(url))
    root = db.get()
    root._p_jar.sync()
    config = root.get('config', {})
    configured = configurator.valid(config)
    action = root.get('action', {})
    what = action.get('what')
    when = action.get('when')
    current = root.get('current_file')
    return f.render_template('index.html',
                             configured=configured,
                             what=what,
                             when=when,
                             current_file=dict(current),
                             errored=root.get('errored', [])[-20:],
                             **config)