In REACT I have 2 types of authentication: 1 with google and 1 with microsoft. The part from Microsoft was done for a co
Posted: Sun Jul 03, 2022 12:01 pm
In REACT I have 2 types of authentication: 1 with google and 1with microsoft. The part from Microsoft was done for a coworker, soIm doing the google authentication part. The App.jsx has already aMainContent component that will display "Hello Sign in" (this codewas already there since my coworker did his part first so imworking with code already started)
const MainContent = () => {return( <div>
<AuthenticatedTemplate> <Content/></AuthenticatedTemplate>
<UnauthenticatedTemplate> <h5> Hello Sign in</h5></Unauthenticated Template>
</div>)}
and that is in the App component like this
function App(){ return(
<Page Layout> <MainContent/><Page Layout>
)}
MY QUESTION IS: When I created the google authentication partand the user is authenticated is still showing Hello Signin since is not authenticated with microsoft (as youcan see the main content component that checks that...but it iswith google if the user chooses google instead on Micr. but how canI let the app know?) can I put like an if else inside the return ofthe App() to see if the user chose google instead of microsoft andthat way dont display the main content? of how can I remove the"Hello Sign in" from microsfot?
const MainContent = () => {return( <div>
<AuthenticatedTemplate> <Content/></AuthenticatedTemplate>
<UnauthenticatedTemplate> <h5> Hello Sign in</h5></Unauthenticated Template>
</div>)}
and that is in the App component like this
function App(){ return(
<Page Layout> <MainContent/><Page Layout>
)}
MY QUESTION IS: When I created the google authentication partand the user is authenticated is still showing Hello Signin since is not authenticated with microsoft (as youcan see the main content component that checks that...but it iswith google if the user chooses google instead on Micr. but how canI let the app know?) can I put like an if else inside the return ofthe App() to see if the user chose google instead of microsoft andthat way dont display the main content? of how can I remove the"Hello Sign in" from microsfot?