Sha256: c2c5163edce42c91a2ccbf9c586b19d87997338df66ae7860f0e749470e2dc40
Contents?: true
Size: 852 Bytes
Versions: 62
Compression:
Stored size: 852 Bytes
Contents
/** * @namespace WORKAREA.authenticityToken */ WORKAREA.registerModule('authenticityToken', (function () { 'use strict'; var authenticityToken = JST['workarea/storefront/templates/authenticity_token'], appendAuthenticityToken = function(index, form) { WORKAREA.currentUser.gettingUserData.done(function(user) { var $form = $(form), $existingInput = $('input[name="'+user.csrf_param+'"]', $form); if (_.isEmpty($existingInput)) { $form.append(authenticityToken(user)); } else { $existingInput.val(user.csrf_token); } }); }, init = function($scope) { $('form', $scope).each(appendAuthenticityToken); }; return { init: init }; }()));
Version data entries
62 entries across 62 versions & 1 rubygems