question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Documentation Ideas

See original GitHub issue

Describe the feature

Add documentation and optionally sample code for:

Additional information

[1] attempt at strapi from discord user Hum+ (thanks 🙇 )

import CredentialsProvider from "next-auth/providers/credentials";
import { NuxtAuthHandler } from "#auth";

export default NuxtAuthHandler({
  secret: process.env.NUXT_SECRET,
  providers: [
    // @ts-ignore Import is exported on .default during SSR, so we need to call it this way. May be fixed via Vite at some point
    CredentialsProvider.default({
      // The name to display on the sign in form (e.g. 'Sign in with...')
      name: "Credentials",

      // Strapi expects { identifier: 'username or email', password: 'abcde' } we can deal with this at the fetch req
      credentials: {
        username: { label: 'Username', type: 'text', placeholder: 'Test user' },
        password: { label: 'Password', type: 'password' }
      },
      async authorize(credentials: any) {

        const user = await $fetch(`${process.env.STRAPI_BASE_URL}/api/auth/local/`, {
          method: "POST",
          body: JSON.stringify({
            identifier: credentials.username,
            password: credentials.password,
          }),
        });

        if (user) {
         
          return user;
        } else {
         
          return null;

        }
      },
    }),
  ],
  session: {
    jwt: true,
  },

});

[2] passing username and password to signIn, e.g., to use on ytour own page:

await signIn('credentials', { callbackUrl: '/', username: 'jsmith', password: 'hunter2' })

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
danpastoricommented, Dec 14, 2022

@BracketJohn Would be really stoked for Sanctum support as well! Check out this repo if you need any inspiration. It works great for Sanctum Auth: https://github.com/amrnn90/breeze-nuxt.

1reaction
madsh93commented, Nov 27, 2022

Hi @BracketJohn

Would it be possible to add Directus CMS documentation as well? I am having troubles with refresh tokens. I’ve made a gist on my current setup.

https://gist.github.com/madsh93/eb2e36d19af3e73bfec8251f51448bc5

I’ll happily provide access to a Directus CMS to test. I’m on Sidebase Discord server if you’d like to discuss it “Mads#6530”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Companies Using RFCs or Design Docs and Examples of These
RFC Examples and Templates · Google · Uber · Sourcegraph · HashiCorp · SoundCloud · RazorPay · Monzo · Dune Analytics.
Read more >
RFCs: Lightweight Technical Designs | by Carsten Zimmermann
RFC documents are the deliverables for discovery tickets: they outline their findings and proposals. A template can be found here. There is no ......
Read more >
Requests for comments (RFCs) - Sourcegraph handbook
RFCs give us a way to write down ideas and plans so we can communicate, collect thoughtful feedback from others on the team, ......
Read more >
A thorough team guide to RFCs - LeadDev
The life cycle of an RFC · Proposing · Commenting or suggesting · Deciding · Archiving and updating · Tooling.
Read more >
Documenting Design Decisions using RFCs and ADRs
This document, your Request for Comments (RFC), is at best placed close to where it will be used later on, for example in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found