Added new test-build that includes OpenID connect to test with KeyCloak

This commit is contained in:
frikky
2022-02-02 04:15:16 +01:00
parent 4e3f0833ad
commit c11051c7eb
4 changed files with 308 additions and 85 deletions
+13 -1
View File
@@ -1,5 +1,5 @@
/* eslint-disable react/no-multi-comp */
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import { makeStyles } from "@material-ui/styles";
import { useInterval } from "react-powerhooks";
@@ -55,6 +55,7 @@ const LoginDialog = (props) => {
const [MFAField, setMFAField] = useState(false);
const [MFAValue, setMFAValue] = useState("");
// Used to swap from login to register. True = login, false = register
const classes = useStyles();
@@ -468,6 +469,7 @@ const LoginDialog = (props) => {
<div style={{ textAlign: "center", margin: 10 }}>
<Button
fullWidth
id="sso_button"
color="secondary"
variant="outlined"
type="button"
@@ -491,6 +493,16 @@ const LoginDialog = (props) => {
const loadedCheck = isLoaded ? <div>{basedata}</div> : <div></div>;
useEffect(() => {
if (ssoUrl !== undefined && ssoUrl !== null && ssoUrl.length > 0) {
//id="sso_button"
const ssoBtn = document.getElementById("sso_button");
if (ssoBtn !== undefined && ssoBtn !== null) {
console.log("SSO BTN: ", ssoBtn)
}
}
}, [ssoUrl])
return <div>{loadedCheck}</div>;
};