Skip to content

Commit 59198d1

Browse files
authored
chore(docs) Remove spaces from imported identifier (#12644)
remove spaces from imported identifier
1 parent 3287f0b commit 59198d1

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

docs/components/OAuthProviderInstructions/content/components/SetupCode.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { Pre, Code as NXCode } from "nextra/components"
33
import { TSIcon } from "./TSIcon"
44

55
interface Props {
6-
providerName: string
6+
providerSymbol: string
77
providerId: string
88
highlight: (code: string) => string
99
}
1010

11-
export function SetupCode({ providerId, providerName, highlight }: Props) {
11+
export function SetupCode({ providerId, providerSymbol, highlight }: Props) {
1212
return (
1313
<Code>
1414
<Code.Next>
@@ -25,10 +25,10 @@ export function SetupCode({ providerId, providerName, highlight }: Props) {
2525
dangerouslySetInnerHTML={{
2626
__html: highlight(`
2727
import NextAuth from "next-auth"
28-
import ${providerName} from "next-auth/providers/${providerId}"
28+
import ${providerSymbol} from "next-auth/providers/${providerId}"
2929
3030
export const { handlers, signIn, signOut, auth } = NextAuth({
31-
providers: [${providerName}],
31+
providers: [${providerSymbol}],
3232
})`),
3333
}}
3434
/>
@@ -64,10 +64,10 @@ export const { GET, POST } = handlers
6464
dangerouslySetInnerHTML={{
6565
__html: highlight(`
6666
import { QwikAuth$ } from "@auth/qwik"
67-
import ${providerName} from "@auth/qwik/providers/${providerId}"
67+
import ${providerSymbol} from "@auth/qwik/providers/${providerId}"
6868
6969
export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$({
70-
providers: [${providerName}],
70+
providers: [${providerSymbol}],
7171
}) `),
7272
}}
7373
/>
@@ -86,10 +86,10 @@ export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$({
8686
dangerouslySetInnerHTML={{
8787
__html: highlight(`
8888
import { SvelteKitAuth } from "@auth/sveltekit"
89-
import ${providerName} from "@auth/sveltekit/providers/${providerId}"
89+
import ${providerSymbol} from "@auth/sveltekit/providers/${providerId}"
9090
9191
export const { handle, signIn } = SvelteKitAuth({
92-
providers: [${providerName}],
92+
providers: [${providerSymbol}],
9393
}) `),
9494
}}
9595
/>
@@ -145,14 +145,14 @@ export const load: LayoutServerLoad = async (event) => {
145145
dangerouslySetInnerHTML={{
146146
__html: highlight(`
147147
import { ExpressAuth } from "@auth/express"
148-
import ${providerName} from "@auth/express/providers/${providerId}"
148+
import ${providerSymbol} from "@auth/express/providers/${providerId}"
149149
import express from "express"
150150
151151
const app = express()
152152
153153
// If app is served through a proxy, trust the proxy to allow HTTPS protocol to be detected
154154
app.set('trust proxy', true)
155-
app.use("/auth/*", ExpressAuth({ providers: [ ${providerName} ] }))
155+
app.use("/auth/*", ExpressAuth({ providers: [ ${providerSymbol} ] }))
156156
`),
157157
}}
158158
/>

docs/components/OAuthProviderInstructions/content/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function OAuthInstructions({ providerId, disabled = false }: Props) {
3838
}
3939

4040
const providerName = manifest.providersOAuth[providerId]
41+
const providerSymbol = providerName.replace(/\s+/g, "")
4142
const envVars = [
4243
`AUTH_${providerId.toUpperCase().replace(/-/gi, "_")}_ID={CLIENT_ID}`,
4344
`AUTH_${providerId.toUpperCase().replace(/-/gi, "_")}_SECRET={CLIENT_SECRET}`,
@@ -205,7 +206,7 @@ export function OAuthInstructions({ providerId, disabled = false }: Props) {
205206
</p>
206207
<SetupCode
207208
providerId={providerId}
208-
providerName={providerName}
209+
providerSymbol={providerSymbol}
209210
highlight={highlight}
210211
/>
211212
{/* Step 4 */}

0 commit comments

Comments
 (0)