mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:33:24 +02:00
Fixed autofill for HTTPS.
Added dummy API endpoint for autofill POST requests. Autofill also reads the CSRF token from cookies and doesn't require an 'about:blank' anymore on the forms.
This commit is contained in:
@@ -87,6 +87,15 @@ module.exports = function(options) {
|
||||
app.use(csrf())
|
||||
app.use(validator())
|
||||
|
||||
app.use(function(req, res, next) {
|
||||
res.cookie('XSRF-TOKEN', req.csrfToken())
|
||||
next()
|
||||
})
|
||||
|
||||
app.all('/app/api/v1/dummy', function(req, res) {
|
||||
res.send('')
|
||||
})
|
||||
|
||||
app.get('/', function(req, res) {
|
||||
res.render('index')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user