@ebubekirylmaz/link-test 1.0.0 → 1.1.0
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
package/src/config/config.js
CHANGED
|
@@ -3,10 +3,9 @@ import {
|
|
|
3
3
|
MenuConfigSchema,
|
|
4
4
|
TemplateConfigSchema,
|
|
5
5
|
} from "./schemas.js";
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import configTemplate from "/Users/ebubekiryilmaz/Documents/greycollar/dashboard/config.template.js";
|
|
6
|
+
import configMain from "../../../../../config.js";
|
|
7
|
+
import configMenu from "../../../../../config.menu.js";
|
|
8
|
+
import configTemplate from "../../../../../config.template.js";
|
|
10
9
|
import { publish } from "@nucleoidai/react-event";
|
|
11
10
|
|
|
12
11
|
let _mainConfig = {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Card, Tooltip, Typography } from "@mui/material";
|
|
2
|
-
|
|
3
1
|
import AnimatedNode from "./AnimatedNode";
|
|
4
|
-
import Iconify from "
|
|
2
|
+
import { Iconify } from "@canmingir/link/platform/components";
|
|
5
3
|
import LoadingNode from "./LoadingNode";
|
|
6
4
|
import React from "react";
|
|
7
5
|
|
|
6
|
+
import { Card, Tooltip, Typography } from "@mui/material";
|
|
7
|
+
|
|
8
8
|
const ActionNode = ({
|
|
9
9
|
visible,
|
|
10
10
|
delay,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Iconify } from "@canmingir/link/platform/components";
|
|
2
|
+
|
|
1
3
|
import React, { useEffect, useState } from "react";
|
|
2
4
|
import { alpha, styled } from "@mui/material/styles";
|
|
3
5
|
|
|
4
|
-
import Iconify from "../../Iconify/index";
|
|
5
|
-
|
|
6
6
|
const ANIMATION_DELAY_MS = 200;
|
|
7
7
|
|
|
8
8
|
const MainContainer = styled("div", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { loginWithCognito } from "./cognitoAuth";
|
|
2
|
+
import { storage } from "@nucleoidjs/webstorage";
|
|
2
3
|
import { useState } from "react";
|
|
3
4
|
|
|
4
5
|
import { Button, Stack, TextField, Typography } from "@mui/material";
|
|
@@ -10,12 +11,13 @@ export default function CognitoLogin() {
|
|
|
10
11
|
const handleLogin = async () => {
|
|
11
12
|
try {
|
|
12
13
|
const tokens = await loginWithCognito(username, password);
|
|
13
|
-
console.log(tokens);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
console.log("Login successful, tokens:", tokens);
|
|
15
|
+
storage.set("link", "accessToken", tokens.AccessToken);
|
|
16
|
+
storage.set("link", "refreshToken", tokens.RefreshToken);
|
|
16
17
|
window.location.href = "/";
|
|
17
18
|
} catch (e) {
|
|
18
|
-
|
|
19
|
+
console.error("Login error:", e);
|
|
20
|
+
alert(`Login failed: ${e.message || e}`);
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
23
|
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
+
import config from "../../config/config";
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
CognitoIdentityProviderClient,
|
|
3
5
|
InitiateAuthCommand,
|
|
4
6
|
} from "@aws-sdk/client-cognito-identity-provider";
|
|
5
7
|
|
|
6
|
-
import config from "../../config/config";
|
|
7
|
-
|
|
8
8
|
const { credentials } = config();
|
|
9
9
|
|
|
10
10
|
const client = new CognitoIdentityProviderClient({
|
|
11
11
|
region: credentials?.region,
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
+
console.log("Initialized Cognito Client with region:", credentials?.region);
|
|
15
|
+
console.log("credentials", credentials?.clientId);
|
|
16
|
+
|
|
14
17
|
export async function loginWithCognito(username, password) {
|
|
15
18
|
const command = new InitiateAuthCommand({
|
|
16
19
|
AuthFlow: "USER_PASSWORD_AUTH",
|
|
17
|
-
ClientId: credentials
|
|
20
|
+
ClientId: credentials?.clientId,
|
|
18
21
|
AuthParameters: {
|
|
19
22
|
USERNAME: username,
|
|
20
23
|
PASSWORD: password,
|
package/vite/vite.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ConfigSchema } from "../src/config/schemas.js";
|
|
2
2
|
import checker from "vite-plugin-checker";
|
|
3
|
-
import config from "
|
|
3
|
+
import config from "../../../../config.js";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import react from "@vitejs/plugin-react";
|
|
6
|
-
|
|
6
|
+
import { splitVendorChunkPlugin } from "vite";
|
|
7
7
|
import svgr from "vite-plugin-svgr";
|
|
8
8
|
|
|
9
9
|
const { value, error } = ConfigSchema.validate(config);
|
|
@@ -18,7 +18,7 @@ async function vite() {
|
|
|
18
18
|
|
|
19
19
|
return {
|
|
20
20
|
plugins: [
|
|
21
|
-
|
|
21
|
+
splitVendorChunkPlugin(),
|
|
22
22
|
react(),
|
|
23
23
|
svgr(),
|
|
24
24
|
checker({
|