aws-samples / amazon-cognito-passwordless-auth

Passwordless authentication with Amazon Cognito: FIDO2 (WebAuthn, support for Passkeys), Magic Link, SMS OTP Step Up
Apache License 2.0
382 stars 70 forks source link

Can we load logo from assets folder locally #183

Closed cordev-developer closed 1 month ago

cordev-developer commented 3 months ago

Hi guys,

Hope you are doing well. Lastly I've been working with the React Example with FIDO2, especifically I have one doubt about why we need to load the logo from our brand with a URL, I wonder if maybe is there a possibility to load our brand logo from local folder in Visual Studio Code. I refer to this part of code in which we see the logo URL, maybe is it possible ?:

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(

{/* Add Fido2Toast below App so it is rendered on top */}

);

ottokruse commented 3 months ago

Hi mate. Not sure would have to experiment. Wouldn't be surprised if this would just work:

import backgroundImageUrl from "./path1/backgroundImage.png";
import customerLogoUrl from "./path2/logo.png";

<PasswordlessComponent brand={{backgroundImageUrl, customerName: "Your company", customerLogoUrl}}>

Because afaik Vite resolves such imports to a path.

Suggest to check out Vite docs: https://vitejs.dev/guide/assets

cordev-developer commented 3 months ago

Wow !!

Amazing, job done !, your code works well, as you can see I have to update my knowledge about JS, but I will do it. Ey ottokruse, I saw your profile in Github, now I'm your follower jeje. I wonder if I can tell you some doubts about this FIDO2 example since I've been working in a Cognito course published in Udemy and in a online academy of my friend. My intention is to traslate the course to English (is not a problem, I've the B2 level) since both course were published in Spanish for the moment. You can check it at: Spanish Cognito Course, in this particular course I have not published this FIDO2 example, but in the online academy of my friend I have published this example, but I want to add more classes about how to implement the example with React and Amplify hence I have had these questions.

As I saw you work as AWS Engineer and maybe you work with Cognito and/or authentication department, and I thought if I can write some mail to your email of your Github profile if I found some difficult questions about this FIDO2 example, or if you want I will ask you in this Github issues. Also, I've suscribed to AWS support since it is a complex topic and it has taken me two years to prepare the Udemy course (combined with a master's degree and other little personal projects). Thanks in advance !!

Have an awesome day ahead.

ottokruse commented 3 months ago

Hi mate. Sure feel free to email me (you can find my email in my commits ;)) However if you have non-sensitive questions that would help others as well to know the answer to, please just use a GitHub issue (best: a new issue for each question).

GREAT WORK you're doing, thank you for spreading Cognito knowledge!

cordev-developer commented 3 months ago

Hi ottokruse, ok great ! I will follow your recommendations, I thought it's a great idea to share the questions with other mates. I will continue with my new section about Passkeys and FIDO2, thanks a lot !

Have an awesome day ahead.