overleaf/services/web/frontend/js/main/post-gateway.js
Simon Detheridge cd8693db40 Merge pull request #2540 from overleaf/spd-saml-post-gateway
Add generic POST gateway to handle samesite=lax session cookies

GitOrigin-RevId: e50a0fde63659a77a047e545a22fba5339f16427
2020-01-30 04:16:26 +00:00

17 lines
486 B
JavaScript

define(['base'], App =>
App.controller('PostGatewayController', function($scope) {
$scope.handleGateway = function() {
const { params } = JSON.parse($('#gateway-data').text())
params.viaGateway = 'true'
Object.keys(params).forEach(param => {
$('<input>')
.attr({
type: 'hidden',
name: param,
value: params[param]
})
.appendTo('#gateway')
})
$('#gateway').submit()
}
}))