Skip to content

Commit 2f82d6d

Browse files
committed
Fix issues with auth login with changes in version
1 parent c17fce5 commit 2f82d6d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backbone.drupal.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Backbone.Drupal.Auth = (function(Backbone, $, _){
2424

2525
// Set defaults. These are the only attributes allowed.
2626
function defaults() {
27-
return { crossDomain: false, version: 7, dataType: '' };
27+
return { crossDomain: false };
2828
}
2929

3030
// Set attributes
@@ -53,7 +53,7 @@ Backbone.Drupal.Auth = (function(Backbone, $, _){
5353
var status = false;
5454
var restEndpoint = Backbone.Drupal.restEndpoint.root + (Backbone.Drupal.restEndpoint.root.charAt(Backbone.Drupal.restEndpoint.root.length - 1) === '/' ? '' : '/');
5555

56-
if(attributes.version == 8) {
56+
if(Backbone.Drupal.restEndpoint.version == 8) {
5757
// Prepare further calls to use Basic Auth againt drupal 8 and set a cookie
5858
var settings = {
5959
beforeSend: function (request) {
@@ -76,7 +76,7 @@ Backbone.Drupal.Auth = (function(Backbone, $, _){
7676

7777
status=true;
7878
}
79-
else if(attributes.version != 8) {
79+
else if(Backbone.Drupal.restEndpoint.version != 8) {
8080
// Call user/login end point to get CSR token an use in following calls
8181
jQuery.ajax({
8282
async: false,

0 commit comments

Comments
 (0)