Skip to content

Commit

Permalink
Respect visible field in SSO provider configuration (#1948)
Browse files Browse the repository at this point in the history
* hide SSO buttons when new visibility config is set to false

* meln
  • Loading branch information
OskarDamkjaer authored Nov 6, 2023
1 parent adeb621 commit a039ffc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"luxon": "2.5.2",
"memoize-one": "^5.2.1",
"monaco-editor": "0.23.0",
"neo4j-client-sso": "1.2.2",
"neo4j-client-sso": "1.2.3",
"neo4j-driver": "5.9.2",
"re-resizable": "^6.9.9",
"react": "^17.0.2",
Expand Down
4 changes: 3 additions & 1 deletion src/browser/modules/Stream/Auth/ConnectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ export default function ConnectForm(props: ConnectFormProps): JSX.Element {

{props.authenticationMethod === SSO &&
!SSOLoading &&
SSOProviders.map((provider: SSOProvider) => (
SSOProviders.filter(provider => {
return 'visible' in provider ? provider.visible : true
}).map((provider: SSOProvider) => (
<StyledSSOButtonContainer key={provider.id}>
<FormButton
onClick={() => {
Expand Down
1 change: 1 addition & 0 deletions src/shared/modules/connections/connectionsDuck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ export type SSOProvider = {
}
auth_endpoint: string
well_known_discovery_uri: string
visible: boolean
}

export type DiscoverDataAction = {
Expand Down
3 changes: 1 addition & 2 deletions src/shared/modules/discovery/discoveryHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { pick } from 'lodash'
import {
DiscoveryResult,
FetchError,
NoProviderError,
authLog,
fetchDiscoveryDataFromUrl
} from 'neo4j-client-sso'
Expand Down Expand Up @@ -93,7 +92,7 @@ type TaggedDiscoveryData = DiscoverableData & {
source: DiscoveryDataSource
urlMissing: boolean
host: string
onlyCheckForHost?: boolean
onlyCheckForHost: boolean
}

type DiscoveryDataSource =
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10500,10 +10500,10 @@ neo-async@^2.5.0, neo-async@^2.6.1:
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
integrity sha1-tKr7k+OustgXTKU88WOrfXMIMF8=

neo4j-client-sso@1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/neo4j-client-sso/-/neo4j-client-sso-1.2.2.tgz#146f96ca8e23654c70e5bd5a7f98a3acb286ce2c"
integrity sha1-FG+Wyo4jZUxw5b1af5ijrLKGziw=
neo4j-client-sso@1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/neo4j-client-sso/-/neo4j-client-sso-1.2.3.tgz#e53da35442c57b76fa1d7a53bbbc9501f7b4de17"
integrity sha512-F/bZ8VfuNPNL68M6DiD3V4S6/ihdnAD8iEeR2rxqaZPPbch7KRO0PPGQqgkO7H+SaO1ayz9Q9ZYLifzxohossg==
dependencies:
file-saver "^2.0.5"
jwt-decode "^3.1.2"
Expand Down

0 comments on commit a039ffc

Please sign in to comment.