@ebubekirylmaz/link-test 1.2.20 → 1.2.21
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
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
});
|
|
18
|
+
|
|
19
|
+
console.log("✅ Amplify Auth configured");
|
|
@@ -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
|
-
}
|