This repository has been archived by the owner on Jul 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
340 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { NextResponse } from "next/server"; | ||
import { fetcher } from "@/tools/fetch"; | ||
import { jwtDecrypt } from "jose"; | ||
import { BW_SECRET_KEY } from "@/tools/tokens"; | ||
import createClient from "@/supabase/server"; | ||
|
||
export const revalidate = 0; | ||
|
||
export async function POST(request: Request) { | ||
const body = await request.json(); | ||
|
||
const supabase = createClient(); | ||
|
||
const { | ||
data: { user: user }, | ||
error: userError, | ||
} = await supabase.auth.getUser(); | ||
|
||
if (userError) { | ||
return NextResponse.json({ error: userError }); | ||
} | ||
|
||
const { payload: githubApiToken } = await jwtDecrypt( | ||
user?.user_metadata["githubApiToken"], | ||
BW_SECRET_KEY | ||
); | ||
|
||
const { payload: railwayApiToken } = await jwtDecrypt( | ||
user?.user_metadata["railwayApiToken"], | ||
BW_SECRET_KEY | ||
); | ||
|
||
return NextResponse.json({ message: "Success" }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,11 @@ | |
"build": "turbo run build", | ||
"dev": "turbo run dev --parallel", | ||
"start": "pnpm build && turbo run start --parallel", | ||
"format": "prettier *.json *.yaml *.md ./core ./assets ./create-botway-bot ./packages -w" | ||
"format": "prettier *.json *.yaml *.md ./core ./assets ./create-botway-bot ./packages ./strg -w" | ||
}, | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"prettier": "^2.8.8", | ||
"turbo": "^1.9.4" | ||
"turbo": "^1.9.6" | ||
} | ||
} |
Oops, something went wrong.