mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
fix: Fix cookie issue
This commit is contained in:
@@ -5,12 +5,21 @@ import { domain } from "./dns";
|
|||||||
import { secret } from "./secret";
|
import { secret } from "./secret";
|
||||||
import { postgres } from "./postgres";
|
import { postgres } from "./postgres";
|
||||||
|
|
||||||
|
const urls = new sst.Linkable("Urls", {
|
||||||
|
properties: {
|
||||||
|
api: `https://api.${domain}`,
|
||||||
|
auth: `https://auth.${domain}`,
|
||||||
|
site: $dev ? "http://localhost:3000" : `https://console.${domain}`,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const apiFn = new sst.aws.Function("ApiFn", {
|
const apiFn = new sst.aws.Function("ApiFn", {
|
||||||
vpc,
|
vpc,
|
||||||
handler: "packages/functions/src/api/index.handler",
|
handler: "packages/functions/src/api/index.handler",
|
||||||
streaming: !$dev,
|
streaming: !$dev,
|
||||||
link: [
|
link: [
|
||||||
bus,
|
bus,
|
||||||
|
urls,
|
||||||
auth,
|
auth,
|
||||||
postgres,
|
postgres,
|
||||||
secret.SteamApiKey,
|
secret.SteamApiKey,
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ export namespace SteamApi {
|
|||||||
|
|
||||||
setCookie(c, "user_id", user.id);
|
setCookie(c, "user_id", user.id);
|
||||||
|
|
||||||
const returnUrl = `${new URL(c.req.url).origin}/steam/callback/${userID}`
|
const returnUrl = `${new URL(Resource.Urls.api).origin}/steam/callback/${userID}`
|
||||||
|
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
'openid.ns': 'http://specs.openid.net/auth/2.0',
|
'openid.ns': 'http://specs.openid.net/auth/2.0',
|
||||||
|
|||||||
6
sst-env.d.ts
vendored
6
sst-env.d.ts
vendored
@@ -105,6 +105,12 @@ declare module "sst" {
|
|||||||
"name": string
|
"name": string
|
||||||
"type": "sst.aws.Bucket"
|
"type": "sst.aws.Bucket"
|
||||||
}
|
}
|
||||||
|
"Urls": {
|
||||||
|
"api": string
|
||||||
|
"auth": string
|
||||||
|
"site": string
|
||||||
|
"type": "sst.sst.Linkable"
|
||||||
|
}
|
||||||
"VPC": {
|
"VPC": {
|
||||||
"bastion": string
|
"bastion": string
|
||||||
"type": "sst.aws.Vpc"
|
"type": "sst.aws.Vpc"
|
||||||
|
|||||||
Reference in New Issue
Block a user