Hi, I have the following code:

def login():
    ...
    if request.args(0) == 'facebook':
        from gluon.contrib.login_methods.oauth20_account import
OAuthAccount
        auth.settings.login_form = FacebookAccount(globals())
    return dict(form=auth.login())

When I go to the url .../login/facebook, I get directed to facebook's
login page.  I can login successfully, but instead of going to
auth.settings.login_next, I get redirected to ../login.  I think it is
because auth.settings.login_next is a URL that has
@auth.requires_login().

I want to be able to support both auth and facebook logins, and with
only ../login, auth.settings.login_form is not set and login will use
auth.  Are there any problems with this approach?

I am using web2py version 1.86.2.

Reply via email to