Replies: 76 comments 50 replies
-
I'm very hopeful about this. We might have to do small adjustments, but I think in most cases, a tiny wrapper on top of I already started to decouple/better namespace our client code, in v4 it will be under See #1473 |
Beta Was this translation helpful? Give feedback.
-
Exciting 😍. Will I then be able to use NextAuth.js in a let's say Vite + Vue app? I'm developing a framework ("Vike") on top of Vite + vite-plugin-ssr + RPC and I'd love to offer authentication to both my React and Vue users with NextAuth.js. Thanks for your wonderful work, it's lovely to see the JS ecosystem maturing. |
Beta Was this translation helpful? Give feedback.
-
If we rewrite the backend a bit, as long as your framework can set cookies and do redirects and handle basic POST/GET requests, it should be good. We would need to separate the I liked the Sveltekit endpoint approach: |
Beta Was this translation helpful? Give feedback.
-
Neat & yes, the backend integration should work then. How about Vue? You mentioned:
Will we be able to have a |
Beta Was this translation helpful? Give feedback.
-
Yes, that would be easy I think. Here is the source code for the react specific frontend: https://github.com/nextauthjs/next-auth/blob/next/src/client/react.js We still have to work out some small things like tab syncing and invalidation of the session, but other than that it should not be hard, hopefully. |
Beta Was this translation helpful? Give feedback.
-
👌. Had a quick look over the source and yea should be fairly easy to port it to Vue's composition API; there aren't that many React specific things going on. AFACIT a common module that factors out the React/view-framework agnostic code should make porting quite easy. Can't wait to see NextAuth.js to become the de facto standard — Vite & Vue users will love it :-). |
Beta Was this translation helpful? Give feedback.
-
It's quite amazing that you don't even need to install |
Beta Was this translation helpful? Give feedback.
-
@wobsoriano Wow neat... would you be up to develop some Vue composition functions? Basically like |
Beta Was this translation helpful? Give feedback.
-
That's awesome @wobsoriano! Looking forward to set some time aside for this enhancement, so we can start the expansion! I will probably need some help for the Vue client. |
Beta Was this translation helpful? Give feedback.
-
Copied contents of Most if it are working now - // store/index.js
export const actions = {
async nuxtServerInit({ commit }, { req }) {
try {
const session = await getSession({ req })
commit('SET_SESSION', session);
} catch (e) {
commit('SET_SESSION', null);
}
}
} <template>
<div>
<div v-for="provider in Object.values(providers)" :key="provider.id">
<button @click="signIn(provider.id)">Sign in with {{ provider.name }}</button>
</div>
</div>
</template>
<script>
import { defineComponent } from '@nuxtjs/composition-api';
import { getProviders, signIn } from '~/modules/next-auth/client';
export default defineComponent({
middleware: 'guest',
setup() {
return {
signIn
}
},
async asyncData() {
const providers = await getProviders()
return {
providers
}
}
})
</script> and adding configs directly to import Providers from 'next-auth/providers';
export default {
// other nuxt config
nextAuth: {
providers: [
Providers.GitHub({
clientId: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET
}),
],
}
} |
Beta Was this translation helpful? Give feedback.
-
@wobsoriano Neat neat 👌. What was your reason to use Nuxt's composition API instead of Vue's one? What do you think of factoring out the common code between |
Beta Was this translation helpful? Give feedback.
-
Actually published a simple Nuxt module for this that later we can add to next-auth/client since Nuxt 2.0 supports Vue 2 only |
Beta Was this translation helpful? Give feedback.
-
Nice 👍. Ideally |
Beta Was this translation helpful? Give feedback.
-
Yeah, the whole client.js file is copied |
Beta Was this translation helpful? Give feedback.
-
I guess it should be easy to factor out the common code? The common code could then live at Thoughts? |
Beta Was this translation helpful? Give feedback.
-
And Express.js example would be awesome! |
Beta Was this translation helpful? Give feedback.
-
Work on SvelteKit officially has started! We now have a MVP in the monorepo! Over the coming weeks, we'll be working on cleaning it up and creating a package for it. https://github.com/nextauthjs/next-auth/tree/main/apps/playground-sveltekit |
Beta Was this translation helpful? Give feedback.
-
any hope for react native? i absolutely would love to have this integrated |
Beta Was this translation helpful? Give feedback.
-
it would be great to be able to use this project with Express. I wish the main core structure would change accordingly. |
Beta Was this translation helpful? Give feedback.
-
I'm getting an error when I run This is the error it gives me:
It's complaining about the
|
Beta Was this translation helpful? Give feedback.
-
Got next-auth working with remix: https://gist.github.com/lawrencecchen/75fee3be74a8cc56aedae66b17d6d83c Are you open to a PR to apps/example-remix? If so, should I open an issue first? Will create standalone after confirmation. @balazsorban44 |
Beta Was this translation helpful? Give feedback.
-
I think I have found a way to get NextAuth working with Expo, so I'll leave a message here and hope that someone will be interested. Proof of concept: https://github.com/intagaming/create-kaol-app. Here's how this works: The login flow looks like so:
A big twist is that I modified the To authorize normal Next.js requests, I pass the I bet that it isn't the best-in-class approach yet, but if so, please let me know. Even better, if you want to improve on this, please do. Just remember to drop a link here so that everyone can collaborate ;) I really want to push this into mainstream. Might seem impossible due to limitations, but I want to know the limitations, if any. If you need any information to elaborate on this, you can find me on Discord: Side note: Discord provider isn't working with PKCE right now, don't know why. GitHub PKCE works fine. |
Beta Was this translation helpful? Give feedback.
-
@balazsorban44 thanks for |
Beta Was this translation helpful? Give feedback.
-
Hey 👋 Just chiming in to link https://github.com/sidebase/nuxt-auth - it's an attempt to bind together approaches from here and other places and also includes client side helpers to male it all work out nicely. One issue we're facing with beta is the prerendered preact that's included + some necessary stuff not being exposed (ai think this is also linked in another issue here?) Thanks for the great discussions in this thread so far, it really helped us to bring nuxt-auth out🙏 |
Beta Was this translation helpful? Give feedback.
-
Some exciting news! We just shipped See more info here: https://twitter.com/balazsorban44/status/1603082914362986496 |
Beta Was this translation helpful? Give feedback.
-
Anyone created Vue version? |
Beta Was this translation helpful? Give feedback.
-
That's a good ambition, but your code just doesn't work from the beginning with get started code example.😂 |
Beta Was this translation helpful? Give feedback.
-
Has there been any work done to make next-auth usable with the astro framework? |
Beta Was this translation helpful? Give feedback.
-
I was working on a PR to add SMS passwordless auth with Twilio similar to how we have passwordless with nodemailer and I noticed a lot of code duplication across the |
Beta Was this translation helpful? Give feedback.
-
Hi, is there anybody here that made it work in pure react.js (SPA)? I'm currently using Auth0 and I'm thinking about switching to auth.js. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
UPDATE from the maintainer (@balazsorban44)
We just shipped
@auth/core
, and NextAuth.js is becoming Auth.js.See more info here: https://twitter.com/balazsorban44/status/1603082914362986496
Follow up of https://twitter.com/balazsorban44/status/1410641689715347461.
cc @s-kris @balazsorban44
next-auth
can actually already be used with Vite today thanks to https://github.com/s-kris/vite-ssr-next-auth.UPDATE FROM MAINTAINER:
Proof of concept:
v4 has been marked as stable, and the source code has been refactored to be Next.js API routes agnostic. It is still undocumented, but we are ready to discuss how to integrate with other frameworks in the open. If you are developing in one of those communities (Vue, Svelte etc.), feel free to reach out!
Beta Was this translation helpful? Give feedback.
All reactions