diff --git a/src/browser/modules/Stream/Auth/ConnectionForm.jsx b/src/browser/modules/Stream/Auth/ConnectionForm.jsx
index ec970007329..b8006ca1632 100644
--- a/src/browser/modules/Stream/Auth/ConnectionForm.jsx
+++ b/src/browser/modules/Stream/Auth/ConnectionForm.jsx
@@ -49,6 +49,7 @@ import {
toggleSchemeRouting,
isNonSupportedRoutingSchemeError
} from 'services/boltscheme.utils'
+import { StyledConnectionBody } from './styled'
export class ConnectionForm extends Component {
constructor(props) {
@@ -260,15 +261,29 @@ export class ConnectionForm extends Component {
{this.props.children}
)
- } else if (this.props.isConnected) {
+ } else if (
+ this.props.isConnected &&
+ this.props.activeConnectionData &&
+ this.props.activeConnectionData.authEnabled !== false // falsy value indicates (except false) we don't know yet, so see that as enabled.
+ ) {
view = (
)
+ } else if (
+ this.props.isConnected &&
+ this.props.activeConnectionData &&
+ this.props.activeConnectionData.authEnabled === false // excplicit false = auth disabled for sure
+ ) {
+ view = (
+
+ You have a working connection and server auth is disabled.
+
+ )
} else if (!this.props.isConnected && !this.state.passwordChangeNeeded) {
view = (
{
activeConnection = true
activeConnectionData = {
username,
- host
+ host,
+ authEnabled: true
}
rerender(
{
...state.connectionsById[connectionId],
authEnabled
}
+
+ if (!authEnabled) {
+ updatedConnection.username = ''
+ updatedConnection.password = ''
+ }
+
const updatedConnectionByIds = {
...state.connectionsById
}
@@ -341,7 +347,7 @@ export const connectEpic = (action$, store) => {
.openConnection(action, {
connectionTimeout: getConnectionTimeout(store.getState())
})
- .then(res => ({ type: action.$$responseChannel, success: true }))
+ .then(() => ({ type: action.$$responseChannel, success: true }))
.catch(e => {
if (!action.noResetConnectionOnFail) {
store.dispatch(setActiveConnection(null))
@@ -587,7 +593,7 @@ export const switchConnectionEpic = (action$, store) => {
{ encrypted: action.encrypted },
onLostConnection(store.dispatch)
)
- .then(connection => {
+ .then(() => {
store.dispatch(setActiveConnection(discovery.CONNECTION_ID))
resolve({ type: SWITCH_CONNECTION_SUCCESS })
})
diff --git a/src/shared/services/bolt/bolt.js b/src/shared/services/bolt/bolt.js
index aefa8175ace..73e75e1ebd9 100644
--- a/src/shared/services/bolt/bolt.js
+++ b/src/shared/services/bolt/bolt.js
@@ -47,7 +47,7 @@ function openConnection(props, opts = {}, onLostConnection) {
return new Promise((resolve, reject) => {
boltConnection
.openConnection(props, opts, onLostConnection)
- .then(r => {
+ .then(() => {
connectionProperties = {
authenticationMethod: props.authenticationMethod || NATIVE,
username: props.username,
@@ -55,7 +55,7 @@ function openConnection(props, opts = {}, onLostConnection) {
host: props.host,
opts
}
- resolve(r)
+ resolve()
})
.catch(e => {
connectionProperties = null
diff --git a/src/shared/services/bolt/globalDrivers.js b/src/shared/services/bolt/globalDrivers.js
index 0c7e5583f64..5d5d13a5881 100644
--- a/src/shared/services/bolt/globalDrivers.js
+++ b/src/shared/services/bolt/globalDrivers.js
@@ -90,7 +90,7 @@ export const buildAuthObj = props => {
) {
auth = neo4j.auth.basic(props.username, props.password)
} else {
- auth = null
+ auth = neo4j.auth.basic('', '')
}
return auth
}