RFC: Documentation Ideas
See original GitHub issueDescribe the feature
Add documentation and optionally sample code for:
- example to configure different dbs
- laravel sanctum
- requests: #16 + more on discord
- laravel JWT
- requests: #32 + more on discord
- optional user data (partially from #29)
- added as recipe in #90: https://sidebase.io/nuxt-auth/recipes/custom-session-data
- directus (see #64)
- added as recipe in #90: https://sidebase.io/nuxt-auth/recipes/directus
- strapi example (from https://discord.com/channels/473401852243869706/1038034318703984650/1041080023219716256)
- added as recipe in #90: https://sidebase.io/nuxt-auth/recipes/strapi
- how to add your own signin page
- security section (from #7)
- how to pass credentials to the
credentialsignIn directly (see [2])
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:
- Created 10 months ago
- Reactions:4
- Comments:6 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@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.
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”.