Skip to content

chore(docs): Fix syntax error in RBAC guide #12733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 22, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(docs): Fix syntax error in RBAC guide
  • Loading branch information
benhovinga committed Mar 5, 2025
commit 4f1f79643e422f9f1ed85a152b98733bdf486ac2
77 changes: 50 additions & 27 deletions docs/pages/guides/role-based-access-control.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ export const { handlers, auth } = NextAuth({
providers: [
Google({
profile(profile) {
return { role: profile.role ?? "user", ... }
return {
role: profile.role ?? "user",
// ...
}
},
})
}),
],
})
```
Expand All @@ -39,7 +42,10 @@ export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(
providers: [
Google({
profile(profile) {
return { role: profile.role ?? "user", ... }
return {
role: profile.role ?? "user",
// ...
}
},
})
],
Expand All @@ -58,9 +64,12 @@ export const { handle } = SvelteKitAuth({
providers: [
Google({
profile(profile) {
return { role: profile.role ?? "user", ... }
return {
role: profile.role ?? "user",
// ...
}
},
})
}),
],
})
```
Expand Down Expand Up @@ -94,20 +103,23 @@ export const { handlers, auth } = NextAuth({
providers: [
Google({
profile(profile) {
return { role: profile.role ?? "user", ... }
return {
role: profile.role ?? "user",
// ...
}
},
})
}),
],
callbacks: {
jwt({ token, user }) {
if(user) token.role = user.role
if (user) token.role = user.role
return token
},
session({ session, token }) {
session.user.role = token.role
return session
}
}
},
},
})
```

Expand All @@ -123,7 +135,10 @@ export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(
providers: [
Google({
profile(profile) {
return { role: profile.role ?? "user", ... }
return {
role: profile.role ?? "user",
// ...
}
},
})
],
Expand Down Expand Up @@ -152,20 +167,23 @@ export const { handle } = SvelteKitAuth({
providers: [
Google({
profile(profile) {
return { role: profile.role ?? "user", ... }
return {
role: profile.role ?? "user",
// ...
}
},
})
}),
],
callbacks: {
jwt({ token, user }) {
if(user) token.role = user.role
if (user) token.role = user.role
return token
},
session({ session, token }) {
session.user.role = token.role
return session
}
}
},
},
})
```

Expand Down Expand Up @@ -213,16 +231,19 @@ export const { handlers, auth } = NextAuth({
providers: [
Google({
profile(profile) {
return { role: profile.role ?? "user", ... }
}
})
return {
role: profile.role ?? "user",
// ...
}
},
}),
],
callbacks: {
session({ session, user }) {
session.user.role = user.role
return session
}
}
},
},
})
```

Expand Down Expand Up @@ -263,17 +284,19 @@ export const { handle, auth } = SvelteKitAuth({
providers: [
Google({
profile(profile) {
return { role: profile.role ?? "user", ... }
}
...
})
return {
role: profile.role ?? "user",
// ...
}
},
}),
],
callbacks: {
session({ session, user }) {
session.user.role = user.role
return session
}
}
},
},
})
```

Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy