@ebubekirylmaz/link-test 1.2.20 → 1.2.22
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/index.js +0 -2
- package/package.json +1 -1
- package/src/Platform.jsx +5 -4
- package/src/widgets/Login/amplifyAuth.js +22 -0
- package/src/widgets/Login/amplifyAuth.jsx +0 -25
package/index.js
CHANGED
package/package.json
CHANGED
package/src/Platform.jsx
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import "./global.css";
|
|
2
|
+
import "./widgets/Login/amplifyAuth";
|
|
3
|
+
|
|
4
|
+
import { BrowserRouter, Navigate } from "react-router-dom";
|
|
5
|
+
import { initialState, reducer } from "./context/reducer";
|
|
6
|
+
import { publish, subscribe, useEvent } from "@nucleoidai/react-event";
|
|
2
7
|
|
|
3
8
|
import ContextProvider from "./ContextProvider/ContextProvider";
|
|
4
9
|
import GlobalSnackMessage from "./GlobalSnackMessage/GlobalSnackMessage";
|
|
@@ -13,10 +18,6 @@ import http from "./http";
|
|
|
13
18
|
import { init } from "./config/config";
|
|
14
19
|
import oauth from "./http/oauth";
|
|
15
20
|
|
|
16
|
-
import { BrowserRouter, Navigate } from "react-router-dom";
|
|
17
|
-
import { initialState, reducer } from "./context/reducer";
|
|
18
|
-
import { publish, subscribe, useEvent } from "@nucleoidai/react-event";
|
|
19
|
-
|
|
20
21
|
init();
|
|
21
22
|
|
|
22
23
|
window["@nucleoidai"] = {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Amplify } from "aws-amplify";
|
|
2
|
+
import config from "../../config/config";
|
|
3
|
+
|
|
4
|
+
const { credentials } = config();
|
|
5
|
+
|
|
6
|
+
if (!credentials) {
|
|
7
|
+
throw new Error("Cognito credentials not initialized");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
Amplify.configure({
|
|
11
|
+
Auth: {
|
|
12
|
+
region: credentials.region,
|
|
13
|
+
userPoolId: credentials.userPoolId,
|
|
14
|
+
userPoolWebClientId: credentials.clientId,
|
|
15
|
+
authenticationFlowType: "USER_SRP_AUTH",
|
|
16
|
+
|
|
17
|
+
// 🔴 IMPORTANT: explicitly disable OAuth / Hosted UI
|
|
18
|
+
oauth: undefined,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
console.log("✅ Amplify Auth configured (SRP, no OAuth)");
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Amplify } from "aws-amplify";
|
|
2
|
-
import config from "../../config/config";
|
|
3
|
-
|
|
4
|
-
let initialized = false;
|
|
5
|
-
|
|
6
|
-
export function initAmplifyAuth() {
|
|
7
|
-
if (initialized) return;
|
|
8
|
-
|
|
9
|
-
const { credentials } = config();
|
|
10
|
-
if (!credentials) {
|
|
11
|
-
throw new Error("Cognito credentials not initialized yet");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
Amplify.configure({
|
|
15
|
-
Auth: {
|
|
16
|
-
region: credentials.region,
|
|
17
|
-
userPoolId: credentials.userPoolId,
|
|
18
|
-
userPoolWebClientId: credentials.clientId,
|
|
19
|
-
authenticationFlowType: "USER_SRP_AUTH",
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
initialized = true;
|
|
24
|
-
console.log("Amplify Auth initialized (SRP)");
|
|
25
|
-
}
|