Skip to content

Commit

Permalink
Authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
jakst committed Dec 14, 2024
1 parent 88f3032 commit cf9c95b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
1 change: 0 additions & 1 deletion packages/server/src/Env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export type Env = {
DO: DurableObjectNamespace
ENV_DISCRIMINATOR: string
PUSHBULLET_AUTH_TOKEN: string
HYPERDX_API_KEY: string
OTEL_SERVICE_NAME: string
OTEL_EXPORTER_OTLP_ENDPOINT: string
Expand Down
19 changes: 1 addition & 18 deletions packages/server/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,24 +242,7 @@ class AShoppingBird {
masterKey: this.env.KEEP_MASTER_KEY,
})

console.log({ authenticated })

if (!authenticated) {
await this.setAuthState(false)

await fetch("https://api.pushbullet.com/v2/pushes", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Access-Token": this.env.PUSHBULLET_AUTH_TOKEN,
},
body: JSON.stringify({
type: "note",
title: "Hello Admin!",
body: "You need to re-authenticate the Shopping Bird bot",
}),
})
}
await this.setAuthState(authenticated)

const client = new ExternalClient({
bot,
Expand Down

0 comments on commit cf9c95b

Please sign in to comment.