remove csrf stuff

This commit is contained in:
Connor Turland 2018-03-05 11:31:54 -05:00
parent edd54b246e
commit a50679fa24
5 changed files with 4 additions and 10 deletions

View file

@ -1,7 +1,7 @@
const request = require('request')
function apiProxyMiddleware (req, res, next) {
if (!(req.xhr || req.originalUrl.indexOf('.json') > -1)) {
if (!(req.xhr || req.originalUrl.indexOf('.json') > -1 || req.method !== 'GET')) {
return next()
}
console.log('xhr request', req.originalUrl)

View file

@ -22,7 +22,7 @@
},
"homepage": "https://github.com/metamaps/metamaps#readme",
"dependencies": {
"action-cable-node": "^1.2.2",
"action-cable-node": "Connoropolous/action-cable-node",
"ajaxq": "0.0.7",
"async": "2.5.0",
"attachmediastream": "2.0.0",

View file

@ -193,7 +193,7 @@
<script type="text/template" id="mapSearchTemplate">
<div class="result{{rtype}}">
<div class="searchResIconWrapper">
<img class="icon" src="<%= asset_path('metamap36c.png') %>">
<img class="icon" src="/images/metamap36c.png">
</div>
<div class="resultText">
<p class="resultTitle">{{label}}</p>

View file

@ -14,11 +14,6 @@ class LoginForm extends Component {
this.state = { token: '' }
}
componentDidMount() {
const token = document.head.getElementsByTagName('meta')['csrf-token'].content
this.setState({token})
}
emailInputDidMount(node) {
node && node.focus()
}
@ -30,7 +25,6 @@ class LoginForm extends Component {
render () {
return <form className="loginAnywhere" id="new_user" action="/login" acceptCharset="UTF-8" method="post">
<input name="utf8" type="hidden" value="✓" />
<input type="hidden" name="authenticity_token" value={this.state.token} />
<div className="accountImage"></div>
<div className="accountInput accountEmail">
<input placeholder="Email" type="email" name="user[email]" id="user_email" ref={this.emailInputDidMount}/>

View file

@ -85,7 +85,7 @@
<script type="text/template" id="mapSearchTemplate">
<div class="result{{rtype}}">
<div class="searchResIconWrapper">
<img class="icon" src="{ asset_path('metamap36c.png') }">
<img class="icon" src="/images/metamap36c.png">
</div>
<div class="resultText">
<p class="resultTitle">{{label}}</p>