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:
parent
d56286a472
commit
f12d2273d5
@ -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;
|
||||||
|
@ -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 {
|
||||||
|
|
||||||
|
@ -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.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user