Hi,

I use legal module with oa2. I tested in a clean installation. When the legal terms has been updated (the user needs to agree the terms of use again when login), the user CANNOT login through /user/login. [it will goto /home page and maintains in NOT login status]

<form action="/user/login" method="post" id="user-login" accept-charset="UTF-8" role="form">
...
<input type="submit" id="edit-submit" name="op" value="Log in" class="form-submit btn btn-default btn-primary"></div></div></form>

Interestingly, they CAN login through login form at /home

<form action="/home?destination=home" method="post" id="user-login-form" accept-charset="UTF-8" role="form">
...
<input type="submit" id="edit-submit" name="op" value="Log in" class="form-submit btn btn-default btn-primary"></div></div></form>

I attached the drupal form for reference.

In drupal clean installation, legal module does not have problem with /user/login. It seems that legal module has issue with "destination in url" (https://www.drupal.org/node/447476#comment-1539240), but I also noticed that oa_core uses hooks to customize login process. Well, this is maybe a issue to legal module, but if any hint to find out the reason would be appreciated.

Many thanks.

CommentFileSizeAuthor
#4 2502013-oa_core_login_redirect-4.patch550 bytesguillaumev
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mpotter’s picture

Having multiple modules that try to redirect the user login is always going to cause a conflict. In v2.5x we might have a way to disable the Atrium user login redirection since we are also trying to make Atrium work better with other login policy modules. But for now you'll need to patch code in oa_core.login.inc in oa_core/includes.

hosais’s picture

Title: Oa2 conflicts with legal module » Oa2 Login redirect conflicts with other module (legal and commerce_checkout_redirect)

Hi,

Yesterday it cost me 5 hours to find out that the same issue happens to the module commerce_checkout_redirect. After anonymous intended to checkout (then login to checkout), with oa2, it wont redirect to checkout page after login. I solve it with a temporal patch code in oa_core.login.inc in oa_core/includes (line 85):

       }
     }
     else {
+      if(!(substr($path, 0, strlen('checkout')) === 'checkout' )) {
       $path = $destination;
+     }
   }
 }
}
 
 /**
  * Pass destination to drupal_goto.  

Hope other people like me does not need to spend time to trace the issue.

On the other hand, Mike mentioned that oa2 had plan to remove redirect part. I am curious how the oa2 will remove this and be able to redirect user to their dashboard. I suppose here it would need some integration with other modules right? it is possible to give the lowest priority to oa2 redirect?

guillaumev’s picture

Note that the same issue is happening with the openid_connect module.

guillaumev’s picture

Here is a patch which removed the hook_user_login altogether.

Argus’s picture

Status: Active » Needs review

Basic workflow on drupal.org

mpotter’s picture

Status: Needs review » Needs work

We weren't planning on removing this redirection. Instead we were planning to allow you to define config options for how the redirect should work and allow you to disable it if needed. The above patch does not provide any configuration options so just removing the hook is not the right approach.

SocialNicheGuru’s picture

any progress made on #6?