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.
这个提交包含在:
父节点
945b218504
当前提交
157382c3b8
|
@ -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(/\/$/, "");
|
||||
|
|
|
@ -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();
|
||||
|
|
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
正在加载...
在新工单中引用