@ebubekirylmaz/link-test 1.1.1 → 1.1.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebubekirylmaz/link-test",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "exports": {
@@ -11,11 +11,17 @@ import { useNavigate } from "react-router-dom";
11
11
  // ----------------------------------------------------------------------
12
12
 
13
13
  export default function Auth0LoginView() {
14
- const { name, project } = config();
14
+ const { name, project, credentials } = config();
15
15
 
16
16
  const handleOAuthLogin = ({ authUrl, clientId, redirectUri, scope }) => {
17
17
  window.location.href = `${authUrl}?client_id=${clientId}&redirect_uri=${redirectUri}&scope=${scope}&response_type=code`;
18
18
  };
19
+
20
+ function signInAsDemo() {
21
+ storage.set("link", "accessToken", "demo-access-token");
22
+ storage.set("link", "refreshToken", "demo-refresh-token");
23
+ }
24
+
19
25
  const navigate = useNavigate();
20
26
 
21
27
  function token() {
@@ -33,6 +39,11 @@ export default function Auth0LoginView() {
33
39
  if (token()) {
34
40
  navigate("/");
35
41
  }
42
+
43
+ if (credentials?.provider === "DEMO") {
44
+ signInAsDemo();
45
+ navigate("/");
46
+ }
36
47
  // eslint-disable-next-line react-hooks/exhaustive-deps
37
48
  }, [navigate]);
38
49