Skip to content

Commit

Permalink
removed lodash dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dzirtusss committed Aug 12, 2016
1 parent ad7fb92 commit 6b57be0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions node_package/src/ReactOnRails.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _ from 'lodash';
import * as ClientStartup from './clientStartup';
import handleError from './handleError';
import ComponentRegistry from './ComponentRegistry';
Expand Down Expand Up @@ -74,18 +73,18 @@ ctx.ReactOnRails = {
},

/**
* Return CFRS authenticity token inserted by Rails
*
* @returns CFRS token
* Returns CFRS authenticity token inserted by Rails csrf_meta_tags
* @returns String or null
*/

getAuthenticityToken() {
const token = _.find(document.querySelectorAll('meta'), ['name', 'csrf-token']);
/*const token = _.find(document.querySelectorAll('meta'), ['name', 'csrf-token']);*/
const token = document.querySelector('meta[name="csrf-token"]');
return token ? token.content : null;
},

/**
*
* Returns header with csrf authenticity token
* @param options
* @returns {*}
*/
Expand Down

0 comments on commit 6b57be0

Please sign in to comment.