-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathmain.tsx
59 lines (56 loc) · 2.15 KB
/
main.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You
* may not use this file except in compliance with the License. A copy of
* the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
* ANY KIND, either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./index.css";
import { Passwordless } from "amazon-cognito-passwordless-auth";
import {
PasswordlessContextProvider,
Passwordless as PasswordlessComponent,
Fido2Toast,
} from "amazon-cognito-passwordless-auth/react";
import "amazon-cognito-passwordless-auth/passwordless.css";
import "@cloudscape-design/global-styles/index.css";
console.debug("App built at:", import.meta.env.VITE_APP_BUILD_DATE);
Passwordless.configure({
cognitoIdpEndpoint: import.meta.env.VITE_COGNITO_IDP_ENDPOINT,
clientId: import.meta.env.VITE_CLIENT_ID,
fido2: {
baseUrl: import.meta.env.VITE_FIDO2_BASE_URL,
authenticatorSelection: {
userVerification: "required",
},
},
debug: console.debug,
});
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<PasswordlessContextProvider enableLocalUserCache={true}>
<PasswordlessComponent
brand={{
backgroundImageUrl:
"https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Manhattan_in_the_distance_%28Unsplash%29.jpg/2880px-Manhattan_in_the_distance_%28Unsplash%29.jpg",
customerName: "Amazon Web Services",
customerLogoUrl:
"https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Amazon_Web_Services_Logo.svg/1280px-Amazon_Web_Services_Logo.svg.png",
}}
>
<React.StrictMode>
<App />
</React.StrictMode>
</PasswordlessComponent>
<Fido2Toast /> {/* Add Fido2Toast below App so it is rendered on top */}
</PasswordlessContextProvider>
);