@visns-studio/visns-components 2.2.8 → 2.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,8 +5,9 @@ import { toast } from 'react-toastify';
5
5
  import { Person, LockOff } from 'akar-icons';
6
6
 
7
7
  import CustomFetch from '../Fetch';
8
+ import { render } from 'react-dom';
8
9
 
9
- const Login = ({ logo, setSystemAuth, setUserProfile }) => {
10
+ const Login = ({ logo, providers, setSystemAuth, setUserProfile }) => {
10
11
  const location = useLocation();
11
12
 
12
13
  const [auth, setAuth] = useState({
@@ -20,6 +21,48 @@ const Login = ({ logo, setSystemAuth, setUserProfile }) => {
20
21
  password: '',
21
22
  });
22
23
 
24
+ const renderSsoButton = () => {
25
+ let content =
26
+ providers.length > 0 ? (
27
+ <div className="formItem fwItem lastItem forgotten">
28
+ <span>OR</span>
29
+ </div>
30
+ ) : null;
31
+
32
+ providers.forEach((provider) => {
33
+ switch (provider) {
34
+ case 'azure':
35
+ content = (
36
+ <>
37
+ {content}
38
+ <div className="formItem fwItem lastItem forgotten">
39
+ <button
40
+ className="btn"
41
+ onClick={(e) => {
42
+ e.preventDefault();
43
+
44
+ window.location.href = '/auth/azure';
45
+ }}
46
+ >
47
+ <img
48
+ src={
49
+ 'https://d16lktya8ojp5z.cloudfront.net/generic/images/microsoft.png'
50
+ }
51
+ width="13px"
52
+ height="13px"
53
+ />{' '}
54
+ Microsoft
55
+ </button>
56
+ </div>
57
+ </>
58
+ );
59
+ break;
60
+ }
61
+ });
62
+
63
+ return content;
64
+ };
65
+
23
66
  const handleChange = (e) => {
24
67
  if (e) {
25
68
  setAuth((prevState) => ({
@@ -145,6 +188,7 @@ const Login = ({ logo, setSystemAuth, setUserProfile }) => {
145
188
  <Link to="/reset">Click Here</Link>
146
189
  </span>
147
190
  </div>
191
+ {renderSsoButton()}
148
192
  </div>
149
193
  </Reveal>
150
194
  </form>
package/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  "react-dom": "^17.0.1"
41
41
  },
42
42
  "name": "@visns-studio/visns-components",
43
- "version": "2.2.8",
43
+ "version": "2.2.9",
44
44
  "description": "Various packages to assist in the development of our Custom Applications.",
45
45
  "main": "index.js",
46
46
  "scripts": {