mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +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');
|
||||
</script>
|
||||
|
||||
<!-- Logging for sentry -->
|
||||
<script src="//cdn.ravenjs.com/1.1.19/raven.min.js"></script>
|
||||
|
||||
<!-- Intercom library -->
|
||||
<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;
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -64,12 +64,15 @@ export function status(response) {
|
||||
}
|
||||
|
||||
export function getCookie(name) {
|
||||
let value = '; ' + document.cookie;
|
||||
let parts = value.split('; ' + name + '=');
|
||||
if (parts.length === 2) {
|
||||
return parts.pop().split(';').shift();
|
||||
let parts = document.cookie.split(';');
|
||||
|
||||
for(let i = 0; i < parts.length; i++) {
|
||||
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