Next.js Authentication with Next Auth - Protected Routes & more

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 61

  • @mjunaid3037
    @mjunaid3037 Год назад +1

    Great 👍
    Love From Bangladesh 🇧🇩🇧🇩

  • @Manjunath-c5n
    @Manjunath-c5n Год назад +1

    axios post for new address throwing error as "login first to access this route" while I have already logged in.

  • @ompatel5226
    @ompatel5226 Год назад

    Great tutorial on Next-Auth also found out something new about api in next, Thanks.

  • @apexyu164
    @apexyu164 Год назад

    thank you for show the different steps by steps

  • @ronjones1587
    @ronjones1587 Год назад +2

    This is amazing! Everything I need to know is here, thank you and keep it up!

  • @sowmocoding5740
    @sowmocoding5740 Год назад +2

    You're a life saver.

  • @usamaahmad6669
    @usamaahmad6669 Год назад +1

    Thank You so much @Coding With Abbas its really simple and understandable
    for me.💕💕

    • @codingwithabbas
      @codingwithabbas  Год назад

      Glad it was helpful! A complete video on Social Authentication with Next.js 13 is coming this week. Stay tuned for that. You will also enjoy that video. Happy Coding!!!

  • @abdrahim9307
    @abdrahim9307 Год назад +1

    thank you very much you saved my life

  • @ICOReviewtoken
    @ICOReviewtoken Год назад

    - This is Middlewheo for my multilingual, how I have to write to be able to use both Protected Route and Border translation, in a file, there is only one method of export default.
    Export Default CreatineintlmiddleWare ({
    Locales: ['vi', 'en'],
    defaultlocale: 'vi'
    })
    - Moreover, I want to protect all the paths with the path began with /Dashboard
    Think is/dashboard/profile or/dashboard/seting/message
    Also Protected Route

  • @rebazjabar7660
    @rebazjabar7660 Год назад

    thanks alot, keep going with next js and javascript i love it

  • @uminhtetoo
    @uminhtetoo Год назад

    Thank you so much for sharing your knowledge, Sir.

  • @sebastiannietor9724
    @sebastiannietor9724 Год назад

    What if I want to secure the / page, the root page?

  • @davidgwyer5169
    @davidgwyer5169 Год назад +2

    Thanks for the detailed video. Would it be easy to add a password reset? No Next Auth tutorials ever seem to include this feature which is essential for credential-based login.

    • @codingwithabbas
      @codingwithabbas  Год назад +5

      I am going to start a complete course on Next.js 13, will create a full stack e-commerce app only in Next.js, I'll add this feature in that app.

    • @ICOReviewtoken
      @ICOReviewtoken Год назад

      @@codingwithabbas Nextjs 13's language translation support is not good at the moment, so I used the next-intl package, you can test it with the case of 2 layouts for dashboard and separate user page to see the problem of route protection with middlware

  • @apexyu164
    @apexyu164 Год назад

    do we need to create a table in mongodb first ? is it naming next13-auth? if no , in which stage of you video have done that ?

  • @theshortclipper
    @theshortclipper Год назад

    Thanks for creating nextjs videos-- i have a question if user is already login and if user tries to goto login page again , then i want user should redirect to some other page

  • @mherkarapetyan4398
    @mherkarapetyan4398 Год назад +1

    Hey Bro, thanks for the tutorial. BTW
    i think it's problem to have callbackUrl as a query params. (35:46)
    how can i remove that callback url from query )
    i've tried to use redirect callback and return empty string but i have callbackUrl= , i don't want to see that callbackUrl at all

    • @codingwithabbas
      @codingwithabbas  Год назад

      So you don't want callback url in any case?

    • @mherkarapetyan4398
      @mherkarapetyan4398 Год назад

      @@codingwithabbas nope

    • @mherkarapetyan4398
      @mherkarapetyan4398 Год назад

      @@codingwithabbas i have middleware.js, and if it's not authorized, it's redirecting to /login,,, but adding queryparam callbackUrl, i don't want to have any query param

  • @R6videos6R
    @R6videos6R Год назад

    Can you make this guide with route handlers? Without the pages folder?

  • @adornnet
    @adornnet Год назад

    Thanks for the useful video. May I know why are we not using the built-in fetch function to post the form ?

  • @postoronnii__
    @postoronnii__ Год назад

    Thanks for the video, Abbas! How to solve the glitch `Login/ Hi, Chulam` when the page is reloaded?

  • @SuperCodepk
    @SuperCodepk Год назад +2

    Simple and great 👍

  • @anirudhachakrabarty2050
    @anirudhachakrabarty2050 Год назад

    error while trying to send data in to register api endpoint
    error - unhandledRejection: MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
    at _handleConnectionErrors (D:
    extauth
    ode_modules\mongoose\lib\connection.js:805:11)
    at NativeConnection.openUri (D:
    extauth
    ode_modules\mongoose\lib\connection.js:780:11) {
    reason: TopologyDescription {
    type: 'Unknown',
    servers: Map(1) { 'localhost:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: null,
    maxElectionId: null,
    maxSetVersion: null,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
    },
    code: undefined
    }

  • @basabdattaray8495
    @basabdattaray8495 Год назад

    Many thanks for the wonderful presentation!

  • @ghulamqadir8299
    @ghulamqadir8299 Год назад

    So Much Amazing

  • @mattmcelligott
    @mattmcelligott Год назад

    why doesnt the user get routed automatically to the callbackurl after successful login?

    • @codingwithabbas
      @codingwithabbas  Год назад

      Watch this video, I have discussed about that:
      ruclips.net/video/MvRmrvMqixs/видео.html

  • @sanjibsaau
    @sanjibsaau Год назад

    How can I make multi role user base admin dashboard ,like admin , editor , or public , can you please make a video ?

    • @codingwithabbas
      @codingwithabbas  Год назад

      That can be implemented easily, I'll create one after Next.js 13 course.

    • @sanjibsaau
      @sanjibsaau Год назад

      ​@@codingwithabbas How many Day I will waiting for that awesome video

  • @RedoxGamingIs
    @RedoxGamingIs Год назад

    33:43 - Protected Routes

  • @opeafolabi
    @opeafolabi Год назад

    Great video! What do we do with the user object after registering. How do you set it up so that you can create a session ? The same way as login?

    • @codingwithabbas
      @codingwithabbas  Год назад

      Are you talking about getting logged in user data?

    • @opeafolabi
      @opeafolabi Год назад

      @@codingwithabbas yeah. Do you have to store as a session manually? Or can you use signIn to register users?

  • @tendulkarsuriya6278
    @tendulkarsuriya6278 13 часов назад

    tq
    helpful

  • @raymondmichael4987
    @raymondmichael4987 Год назад

    Wonderful work, currently I'm i 2:04 time, how can we make that if the user is authenticated redirected directly to the page they were denied before authentication using the redirect url, rather than typing the url by ourselves

    • @codingwithabbas
      @codingwithabbas  Год назад

      You can provide callbackUrl in the signIn options.

  • @maedesolgi8251
    @maedesolgi8251 5 месяцев назад

    How to redirect back to protected route after login?

    • @codingwithabbas
      @codingwithabbas  5 месяцев назад

      You can pass callback url in the signIn function.
      callbackUrl: "/YOUR_ENDPOINT",

  • @fixesdev
    @fixesdev Год назад

    Nice video! how can i protect backend routes?

    • @codingwithabbas
      @codingwithabbas  Год назад

      You can watch that part from this video:
      ruclips.net/video/xOQiI_sd3tY/видео.html&pp=gAQBiAQB

  • @HealingTuneStudio
    @HealingTuneStudio Год назад

    Thank You sir?

  • @SuperCodepk
    @SuperCodepk Год назад

    Just one quick question ⁉️ previously I followed your Udemy course on MERN Stack. Using Next JS 13, we no more need express backend they are simply replaced by next 13 server side components. Right?

    • @codingwithabbas
      @codingwithabbas  Год назад +2

      Yes, In next you don't need express. You can use but not required.

    • @SuperCodepk
      @SuperCodepk Год назад

      @@codingwithabbas Thank you

  • @safiullah7184
    @safiullah7184 Год назад

    Giving me server error with signup

  • @faruksardar8829
    @faruksardar8829 Год назад

    When I add the pages option with the ('/page') object in [...nextauth].js, it works fine and I can see the login button, but when I click the login button it doesn't redirect me to the login page of Google, What could be the reason for this error.
    Thank you in Advance!🫡

    • @codingwithabbas
      @codingwithabbas  Год назад

      Redirecr to login page of google? Are you talking about social login?