angular-drupal icon indicating copy to clipboard operation
angular-drupal copied to clipboard

Authentication window keeps prompting

Open clowNay opened this issue 8 years ago • 4 comments

Hi, I keep getting an authentication popup window, if user is already logged on or passing wrong user details.

screen shot 2015-09-08 at 11 23 04

If i click cancel i get: Failed to load resource: the server responded with a status of 401 (Unauthorized : CSRF validation failed)

If i click cancel on wrong credentials it console logs after i click cancel, meaning i can't show users its a wrong username or password.

My Drupal site is located in a subfolder, while the site is created with Angular as frontend.

clowNay avatar Sep 08 '15 17:09 clowNay

@clowNay Please go through this link. You may find some clues. Make sure you read the discussion till the end. I think, you are having a similar issue.

esafwan avatar Sep 13 '15 18:09 esafwan

I have had similar issues. I followed what @esafwan suggested with no luck. So I've tried changing the request path from /?q=services/session/token to /service/session/token on line 47 andremoving the "/?q=" on line 17, just leaving it as "/". After that all worked great. Maybe enabling CleanURLs can break drupal_angular, I don't know..

ovidius72 avatar Nov 30 '15 13:11 ovidius72

It sounds like we need a config option to let the developer specify whether clean urls are enabled or not in the app. https://github.com/easystreet3/angular-drupal/blob/7.x-1.x/src/angular-drupal.js#L17

There are a few other places where ?q= is explicitly used, so we'd need to catch those as well.

signalpoint avatar Nov 30 '15 14:11 signalpoint

In a Drupal 7 websites, if you visit the page admin/config/search/clean-urls/check you will get a json object that just reports { status:true} if Clean URLs is enabled. Maybe it could be used in the config function to properly set the query path. It doesn't require to be registered the site to check the status. I'm not sure if it's the same for Drupal 6 and 8.

ovidius72 avatar Nov 30 '15 16:11 ovidius72