Skip to content

Commit ee0fc7a

Browse files
committed
feat: make oauth great again!
Signed-off-by: Innei <[email protected]>
1 parent ab0db00 commit ee0fc7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1695
-1200
lines changed

.env.template

-10
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,5 @@ NEXT_PUBLIC_GATEWAY_URL=http://127.0.0.1:2333/
33
NEXT_PUBLIC_API_URL=https://innei.ren/api/v2
44
NEXT_PUBLIC_GATEWAY_URL=https://api.innei.ren
55

6-
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_aaaaaaaaaaaaaaaaaxxxxxx
7-
8-
## Clerk
9-
CLERK_SECRET_KEY=sk_test_
10-
11-
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
12-
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
13-
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
14-
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
15-
166
TMDB_API_KEY=
177
GH_TOKEN=

Dockerfile

+3-7
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,20 @@ WORKDIR /app
1111

1212
COPY . .
1313

14-
1514
RUN npm install -g pnpm
1615
RUN pnpm install
1716

1817
FROM base AS builder
1918

2019
RUN apk update && apk add --no-cache git
2120

22-
2321
WORKDIR /app
2422
COPY --from=deps /app/ .
2523
RUN npm install -g pnpm
2624

2725
ENV NODE_ENV production
2826
ARG BASE_URL
29-
ARG NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
30-
ARG CLERK_SECRET_KEY
27+
3128
ARG S3_ACCESS_KEY
3229
ARG S3_SECRET_KEY
3330
ARG WEBHOOK_SECRET
@@ -36,8 +33,7 @@ ARG GH_TOKEN
3633
ENV BASE_URL=${BASE_URL}
3734
ENV NEXT_PUBLIC_API_URL=${BASE_URL}/api/v2
3835
ENV NEXT_PUBLIC_GATEWAY_URL=${BASE_URL}
39-
ENV NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}
40-
ENV CLERK_SECRET_KEY=${CLERK_SECRET_KEY}
36+
4137
ENV S3_ACCESS_KEY=${S3_ACCESS_KEY}
4238
ENV S3_SECRET_KEY=${S3_SECRET_KEY}
4339
ENV TMDB_API_KEY=${TMDB_API_KEY}
@@ -61,4 +57,4 @@ EXPOSE 2323
6157

6258
ENV PORT 2323
6359
ENV NEXT_SHARP_PATH=/usr/local/lib/node_modules/sharp
64-
CMD echo "Mix Space Web [Shiro] Image." && node server.js;
60+
CMD echo "Mix Space Web [Shiro] Image." && node server.js

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
},
2424
"dependencies": {
2525
"@aws-sdk/client-s3": "3.649.0",
26-
"@clerk/nextjs": "5.5.1",
27-
"@clerk/themes": "2.1.29",
2826
"@excalidraw/excalidraw": "0.17.6",
2927
"@floating-ui/react-dom": "2.1.1",
3028
"@milkdown/core": "7.5.0",
@@ -42,7 +40,9 @@
4240
"@milkdown/utils": "7.5.0",
4341
"@mx-space/api-client": "1.15.0",
4442
"@prosemirror-adapter/react": "0.2.6",
43+
"@radix-ui/react-avatar": "1.1.0",
4544
"@radix-ui/react-dialog": "1.1.1",
45+
"@radix-ui/react-dropdown-menu": "2.1.1",
4646
"@radix-ui/react-label": "2.1.0",
4747
"@radix-ui/react-scroll-area": "1.1.0",
4848
"@radix-ui/react-select": "2.1.1",
@@ -85,6 +85,7 @@
8585
"mermaid": "11.2.0",
8686
"nanoid": "^5.0.7",
8787
"next": "14.2.9",
88+
"next-auth": "4.24.7",
8889
"next-runtime-env": "3.2.2",
8990
"next-themes": "0.3.0",
9091
"ofetch": "1.3.4",
@@ -155,6 +156,7 @@
155156
"tailwind-scrollbar": "3.1.0",
156157
"tailwind-variants": "0.2.1",
157158
"tailwindcss": "^3.4.10",
159+
"tailwindcss-animate": "1.0.7",
158160
"tailwindcss-animated": "1.1.2",
159161
"typescript": "5.6.2",
160162
"zx": "8.1.6"
@@ -202,4 +204,4 @@
202204
"browserslist": [
203205
"defaults and fully supports es6-module"
204206
]
205-
}
207+
}

packages/fetch/src/fetch.server.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ import { createFetch } from 'ofetch'
66

77
import PKG from '~/../package.json'
88

9-
import {
10-
ClerkCookieKey,
11-
createApiClient,
12-
createFetchAdapter,
13-
TokenKey,
14-
} from './shared'
9+
import { createApiClient, createFetchAdapter, TokenKey } from './shared'
1510

1611
const isDev = process.env.NODE_ENV === 'development'
1712
export const $fetch = createFetch({
@@ -20,9 +15,8 @@ export const $fetch = createFetch({
2015

2116
onRequest(context) {
2217
const cookie = cookies()
23-
const clerkJwt = cookie.get(ClerkCookieKey)?.value
2418

25-
const token = cookie.get(TokenKey)?.value || clerkJwt
19+
const token = cookie.get(TokenKey)?.value
2620

2721
const headers: any = context.options.headers ?? {}
2822
if (token) {

packages/fetch/src/shared.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,10 @@ export const createApiClient = (
6262

6363
export const TokenKey = 'mx-token'
6464

65-
export const ClerkCookieKey = '__session'
66-
export const AuthKeyNames = [TokenKey, ClerkCookieKey]
65+
export const AuthKeyNames = [TokenKey]
6766

6867
export function getToken(): string | null {
69-
// FUCK clerk constants not export, and mark it internal and can not custom
70-
// packages/backend/src/constants.ts
71-
const clerkJwt = Cookies.get(ClerkCookieKey)
72-
73-
const token = Cookies.get(TokenKey) || clerkJwt
68+
const token = Cookies.get(TokenKey)
7469

7570
return token || null
7671
}

0 commit comments

Comments
 (0)