Closed BracketJohn closed 8 months ago
Looking at the linked composables I don't think most of those (sign in, sign out, token management, etc) needs to be reimplemented in order to support "Sign-In with Ethereum" functionality. I would instead contribute a smaller abstraction (e.g. adapter/integration/provider, not sure what's the vocabulary here) – a relatively small part of code:
And I imagine that if it's just a provider, it can even live in a different repo/example implementation.
Do you see a technical/organisational problem with what I've described?
Do you see a technical/organisational problem with what I've described?
Not at all! Proposal: Add a new playground-ethereum/
folder by cope-pasting the local
playground. Then you have the freedom to in parallel:
playground-ethereum/
folderIn the end we'll have a full picture of what complexity stays on the users' app-side and what complexity will be moved into the module.
In the future or right in that PR we can then also discuss & move the balance of this abstraction further into the module or into the users' app.
Describe the feature
Goal
Implement a wallet-based login.
Context
On one of our engagements we needed to implement authentication using chain-wallets. We would love to transfer it to this project to offer the same functionality to Nuxt 3 users for an easy entry into the crypto-space.
Providers in
nuxt-auth
generally have two components:authjs
provider: https://github.com/sidebase/nuxt-auth/tree/main/src/runtime/composables/authjslocal
provider: https://github.com/sidebase/nuxt-auth/tree/main/src/runtime/composables/localauthjs
provider: https://github.com/sidebase/nuxt-auth/tree/main/src/runtime/server/services/authjslocal
provider: Not applicable, this could be any backend that provides username & password based flows. A reference implementation using nuxt 3 can be found here: https://github.com/sidebase/nuxt-auth/tree/main/playground-local/server/api/authFor our implementation here client-only + a reference server-side implementation should be sufficient. Later on we can think about providing server-side utilities, but that will also force us to think about default ways to specify DB-adapters and more.
Based on this scope-limitation using the
local
provider as an implementation example should be most helpful. Another interesting resource: @danielwinkelmann started on an implementation of arefresh
provider in #373. The refresh provider is very similar to thelocal
provider with the addition of a periodic token-refresh.Other notes:
docs/v0.6/
folder -> this feature will only be supported by the new v0.6local
andauthjs
already documented)Assets
Related issue + implementation of ethereum based authentication: https://github.com/powerhouse-inc/switchboard-boilerplate/issues/52
Tasks
Additional information
No response