Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless Auth: POC demo #813

Merged
merged 23 commits into from
Oct 23, 2024
Merged

Headless Auth: POC demo #813

merged 23 commits into from
Oct 23, 2024

Conversation

jmderby
Copy link
Contributor

@jmderby jmderby commented Oct 11, 2024

Description

Headless auth integration into our new/existing main server auth endpoints.
Backend ticket: https://github.com/Paella-Labs/crossbit-main/pull/15083

Embedded Auth!

Screenshot 2024-10-15 at 11 07 04 AM

Supported modal/dialog popup for mobile!

Screenshot 2024-10-15 at 5 39 21 PM

Screenshot 2024-10-15 at 5 39 30 PM

Screenshot 2024-10-15 at 5 40 24 PM

and of course regular desktop
Screenshot 2024-10-15 at 5 39 05 PM
styles subject to change


Substantial changes/additions to general Auth

  • added a new component exportable right from react-ui!
  // usage
    import { AuthForm, useAuth } from "@crossmint/client-sdk-react-ui";
    
    export default function Home() {
    const { status } = useAuth(); // "in-progress" | "logged-in" | "logged-out"
    
    if(status === "logged-in"){
	    return "User is logged in"
    }
    
    return (
    <>
	    ...
	    <AuthForm /> // for example, user just signed in via Google
    </>	
    );
    }
  • added a new context provider for handling any state associated to auth form (works for both modal + embedded form)
  • added discord auth
  • added loading state for google sign auth
  • added ability to go back when using Email OTP and Farcaster

Test plan

Tested ALL loginMethods[] and they work.

Package updates

Copy link

vercel bot commented Oct 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
smart-wallet-auth-demo ⬜️ Ignored (Inspect) Visit Preview Oct 23, 2024 5:59pm

Copy link

changeset-bot bot commented Oct 11, 2024

⚠️ No Changeset found

Latest commit: 7f850ee

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jmderby jmderby changed the title Headless Auth: POC demo (WIP) Headless Auth: POC demo Oct 16, 2024
apps/wallets/smart-wallet/next/src/app/_lib/providers.tsx Outdated Show resolved Hide resolved
packages/client/ui/react-ui/package.json Show resolved Hide resolved
packages/client/ui/react-ui/package.json Outdated Show resolved Hide resolved
packages/client/ui/react-ui/src/types/auth.ts Outdated Show resolved Hide resolved
packages/client/ui/react-ui/src/utils/isEmailValid.ts Outdated Show resolved Hide resolved
packages/client/ui/react-ui/src/hooks/useAuthSignIn.ts Outdated Show resolved Hide resolved
@jmderby jmderby merged commit 4e3c83c into main Oct 23, 2024
4 checks passed
@jmderby jmderby deleted the jonathan/headless-auth-poc branch October 23, 2024 18:49
mPaella added a commit that referenced this pull request Oct 26, 2024
* readme: remove beta (#826)

* Headless Auth: POC demo (#813)

* Headless Auth: POC demo

* Added discord auth, added embedded form, added dialog styles

* added merge changes

* fixed styles and added stytch token call

* remove console logs

* removed unused dep

* moved oauth url stuff to backend

* removed embedded component factory and replace with hook component

* replaced component from hook as exported component

* finished farcaster login method

* descoped any web3 changes to separate branch

* removed any login methods to use default

* added test for authformprovider

* removed unused code

* review feedback

* prefetch oauth url on auth form mount

* added more efficient query, removed discord, improved embedded component export

* merge changes with main

* made changes to correspond to recent backend changes

* Auth: add Farcaster auth method to demo (#827)

Auth: add farcaster auth method to demo

* Rename showWalletModals to showPasskeyHelpers (#795)

* Rename showWalletModals to showPasskeyHelpers

* lint fix

* added changeset

* Changesets: Removal of auth iframe, updated common auth sdk (#829)

added changesets

* embed: dynamic.xyz stuff (#832)

* embed: dynamicxyz env

* save

* changeset

* Release packages (#830)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Also send api key in header in oauth fetch to support backend change (#834)

* Release packages (#833)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* embed: add receipt email props (#835)

* embed: add receipt email props

* changeset

* Release packages (#836)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* hosted v3 :init

* straight svg

* rem

---------

Co-authored-by: Jonathan <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alberto Elias <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants