Skip to content

Commit

Permalink
fix: Awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Dec 1, 2023
1 parent f7cfc3c commit 0dc272e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Pages/CallbackPage/CallbackPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ export const CallbackPage = () => {
await magic?.oauth.getRedirectResult()
// Perform the connection once logged in to store the connection data
setIsLoading(false)
getUserSignature()
await getUserSignature()
// Store the signature using the SSO client
// TODO

if (redirectTo) {
window.location.href = redirectTo
} else {
// Navigate to user or to any other site
// TODO: Navigate to the landing page.
navigate('/user')
}
} catch (error) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Pages/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export const LoginPage = () => {
setConnectionModalState(ConnectionModalState.CONNECTING_WALLET)
try {
const connectionData = await connectToProvider(connectionType)
// This is not reached if Magic is used
setConnectionModalState(ConnectionModalState.WAITING_FOR_SIGNATURE)
await getSignature(connectionData.account?.toLowerCase() ?? '', connectionData.provider)
// TODO: Store the signature using the SSO client
// Do something after logging in
if (redirectTo) {
window.location.href = redirectTo
Expand Down

0 comments on commit 0dc272e

Please sign in to comment.