Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable cors for preflight #5

Merged
merged 4 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dbos-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ http:
- 'https://dbos.dev'
telemetry:
logs:
logLevel: 'debug'
logLevel: 'info'
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@dbos-inc/dbos-sdk": "^1.5.4-preview",
"@dbos-inc/dbos-sdk": "^1.6.5-preview",
"jwks-rsa": "^3.1.0",
"koa-jwt": "^4.0.4",
"stripe": "^14.22.0"
Expand Down
6 changes: 3 additions & 3 deletions src/operations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HandlerContext, ArgSource, ArgSources, PostApi, DBOSResponseError, RequiredRole, KoaMiddleware, Authentication, Workflow } from '@dbos-inc/dbos-sdk';
import { HandlerContext, ArgSource, ArgSources, PostApi, DBOSResponseError, RequiredRole, KoaMiddleware, Authentication } from '@dbos-inc/dbos-sdk';
import Stripe from 'stripe';
import jwt from "koa-jwt";
import { koaJwtSecret } from "jwks-rsa";
Expand Down Expand Up @@ -31,7 +31,7 @@ export class CloudSubscription {
ctxt.logger.error("Failed to create a customer portal!");
throw new DBOSResponseError("Failed to create customer portal!", 500);
}
ctxt.koaContext.redirect(sessionURL);
return { url: sessionURL };
}

// This function redirects user to a subscription page
Expand All @@ -49,7 +49,7 @@ export class CloudSubscription {
if (!sessionURL) {
throw new Error("Failed to create a checkout session!")
}
ctxt.koaContext.redirect(sessionURL);
return { url: sessionURL };
}
}

Expand Down