scout/server/blueprints/login/views.py
def login():
    """Login a user if they have access."""
    # store potential next param URL in the session
    if 'next' in request.args:
        session['next_url'] = request.args['next']

    if current_app.config.get('GOOGLE'):
        callback_url = url_for('.authorized', _external=True)
        return google.authorize(callback=callback_url)

    user_email = request.args.get('email')
    user_obj = store.user(user_email)

    if user_obj is None:
        flash("email not whitelisted: {}".format(user_email), 'warning')
        return redirect(url_for('public.index'))

    return perform_login(user_obj)
def login():
    """Login a user if they have access."""
    # store potential next param URL in the session
    if 'next' in request.args:
        session['next_url'] = request.args['next']

    if current_app.config.get('GOOGLE'):
        callback_url = url_for('.authorized', _external=True)
        return google.authorize(callback=callback_url)

    user_email = request.args.get('email')
    user_obj = store.user(user_email)

    if user_obj is None:
        flash("email not whitelisted: {}".format(user_email), 'warning')
        return redirect(url_for('public.index'))

    return perform_login(user_obj)
Login a user if they have access.