mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
bug fix
This commit is contained in:
parent
241f646369
commit
bca85476bc
@ -14,11 +14,16 @@ export async function POST(request: Request) {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
|
||||
const projectId = process.env.NEXT_PUBLIC_STACK_PROJECT_ID;
|
||||
const publishableClientKey = process.env.NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY;
|
||||
|
||||
const user = await stackServerApp.getUser();
|
||||
if (user != null) {
|
||||
if (user != null && projectId != null && publishableClientKey != null) {
|
||||
const accessToken = await user.getAccessToken();
|
||||
if (accessToken != null) {
|
||||
requestHeaders["x-stack-access-type"] = "client";
|
||||
requestHeaders["x-stack-project-id"] = projectId;
|
||||
requestHeaders["x-stack-publishable-client-key"] = publishableClientKey;
|
||||
requestHeaders["x-stack-access-token"] = accessToken;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user