1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

fix csrftoken cookie issue

This commit is contained in:
Tim Daubenschütz 2015-07-16 17:04:37 +02:00
parent d56286a472
commit f12d2273d5
3 changed files with 16 additions and 4 deletions

View File

@ -51,6 +51,9 @@
ga('create', 'UA-60614729-2', 'auto'); ga('create', 'UA-60614729-2', 'auto');
</script> </script>
<!-- Logging for sentry -->
<script src="//cdn.ravenjs.com/1.1.19/raven.min.js"></script>
<!-- Intercom library --> <!-- Intercom library -->
<script> <script>
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true; (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;

View File

@ -32,6 +32,12 @@ requests.defaults({
} }
}); });
Raven.config('https://0955da3388c64ab29bd32c2a429f9ef4@app.getsentry.com/48351', {
// pass along the version of your application
release: '1.0.0'
}).install();
window.onerror = Raven.process;
class AppGateway { class AppGateway {

View File

@ -64,11 +64,14 @@ export function status(response) {
} }
export function getCookie(name) { export function getCookie(name) {
let value = '; ' + document.cookie; let parts = document.cookie.split(';');
let parts = value.split('; ' + name + '=');
if (parts.length === 2) { for(let i = 0; i < parts.length; i++) {
return parts.pop().split(';').shift(); if(parts[i].indexOf('csrftoken=') > -1) {
return parts[i].split('=').pop();
}
} }
throw new Error('There wasn\'t a cookie with name: ' + name + ' found.');
} }
/* /*