Fix mixed content blocked when browsing the UI on HTTPS

When not setting an endpoint protocol scheme at login, "http" was
assumed. Changing this to the same protocol as current one, to avoid
mixed blocked content.

Also prevent multiple submissions of LoginForm.
Este commit está contenido en:
Lucas Verney 2016-07-28 23:57:29 +02:00
padre 945b218504
commit 157382c3b8
Se han modificado 13 ficheros con 75 adiciones y 56 borrados

Ver fichero

@ -1,3 +1,3 @@
{
"presets": ["es2015", "react"]
"presets": ["es2015", "react"],
}

Ver fichero

@ -13,7 +13,7 @@ function _cleanEndpoint (endpoint) {
!endpoint.startsWith("http://") &&
!endpoint.startsWith("https://"))
{
endpoint = "http://" + endpoint;
endpoint = window.location.protocol + "//" + endpoint;
}
// Remove trailing slash and store endpoint
endpoint = endpoint.replace(/\/$/, "");

Ver fichero

@ -26,6 +26,10 @@ class LoginFormIntl extends Component {
handleSubmit (e) {
e.preventDefault();
if (this.props.isAuthenticating) {
// Don't handle submit if already logging in
return;
}
const username = this.refs.username.value.trim();
const password = this.refs.password.value.trim();
const endpoint = this.refs.endpoint.value.trim();

2
app/dist/1.1.js vendido

Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas

Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas

38
app/dist/3.3.js vendido Archivo normal

Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas

Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas

44
app/dist/index.js vendido

Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas

Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas

Ver fichero

@ -1,6 +1,5 @@
// TODO: Refactor using normalizr
// TODO: https://facebook.github.io/immutable-js/ ?
import "babel-polyfill";
import fetch from "isomorphic-fetch";
import humps from "humps";
import X2JS from "x2js";

Ver fichero

@ -1,21 +1,14 @@
#!/bin/sh
# Get against which ref to diff
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
# Initial commit
# TODO
exit 1
fi
js_files=""
for file in $(git diff-index --name-only $against); do
if [[ $file == "*.js" ]] || [[ $file == "*.jsx" ]]
then
js_files="$js_files $file"
fi
done
js_files=$(git diff-index --name-only $against | grep -e ".jsx\?$" | grep -v "^app/dist")
# Nothing more to do if no JS files was committed
if [ -z "$js_files" ]
@ -23,18 +16,6 @@ then
exit 0
fi
# Run webpack
if [ -e "./node_modules/webpack/bin/webpack.js" ]
then
WEBPACK="node ./node_modules/webpack/bin/webpack.js"
elif hash webpack
then
WEBPACK="webpack"
else
exit "You should install webpack."
fi
echo "Rebuilding dist JavaScript files…"
NODE_ENV=production $WEBPACK
NODE_ENV=production npm run build
git add app/dist

Ver fichero

@ -16,7 +16,6 @@
"dependencies": {
"babel-polyfill": "^6.9.1",
"babel-preset-es2015": "^6.9.0",
"babel-runtime": "^6.11.6",
"bootstrap": "^3.3.6",
"fuse.js": "^2.3.0",
"html5shiv": "^3.7.3",

Ver fichero

@ -1,7 +1,6 @@
var path = require("path");
var webpack = require("webpack");
var ReactIntlPlugin=require("react-intl-webpack-plugin");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var postcssReporter = require("postcss-reporter");
var doiuse = require("doiuse");
@ -80,7 +79,6 @@ module.exports = {
},
plugins: [
new ReactIntlPlugin(),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"