Skip to content

Commit

Permalink
fix: worker tweaks, use correct workspace name
Browse files Browse the repository at this point in the history
  • Loading branch information
Battlesquid committed Dec 10, 2024
1 parent 6e6c69e commit cd3add3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ jobs:
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
packageManager: yarn
workingDirectory: ./packages/worker
6 changes: 3 additions & 3 deletions packages/worker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/gr2m/cloudflare-worker-github-oauth-login
*/

import { ExportedHandler, Response } from "@cloudflare/workers-types"
import { type ExportedHandler } from "@cloudflare/workers-types"

interface Env {
CLIENT_ID: string;
Expand Down Expand Up @@ -50,7 +50,7 @@ export default {
}),
}
);
const result = await response.json();
const result = await response.json<{ error: string, access_token: string }>();
const headers = {
"Access-Control-Allow-Origin": "*",
};
Expand All @@ -63,7 +63,7 @@ export default {
status: 201,
headers,
});
} catch (error) {
} catch (error: any) {
console.error(error);
return new Response(error.message, {
status: 500,
Expand Down
6 changes: 1 addition & 5 deletions packages/worker/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,5 @@
"moduleDetection": "force",
"isolatedModules": true
},
"exclude": [
"node_modules",
"dist",
"test"
]
"include": ["src/**/*.ts"]
}
4 changes: 1 addition & 3 deletions packages/worker/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name = "github-oauth-login"
type = "javascript"
account_id = "43a4f22039b08a57004057adc36bf4d0"
compatibility_date = "2024-12-10"
workers_dev = true
main = "src/index.ts"
node_compat = true
main = "src/index.ts"

0 comments on commit cd3add3

Please sign in to comment.