Skip to content

Commit 3fc142a

Browse files
committed
fixed example
1 parent 2eb492f commit 3fc142a

File tree

1 file changed

+13
-14
lines changed
  • references/hello-world/src/trigger

1 file changed

+13
-14
lines changed

references/hello-world/src/trigger/waits.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,20 @@ export const waitToken = task({
5050
expirationTime: "1h",
5151
});
5252

53-
logger.log("Public access token", { publicAccessToken });
54-
55-
if (completeWithPublicToken) {
56-
await auth.withAuth(
57-
{
58-
accessToken: token.publicAccessToken,
59-
},
60-
async () => {
61-
await wait.completeToken<Token>(token.id, { status: "approved" });
62-
}
63-
);
64-
}
65-
6653
if (completeBeforeWaiting) {
67-
await wait.completeToken<Token>(token.id, { status: "approved" });
54+
if (completeWithPublicToken) {
55+
await auth.withAuth(
56+
{
57+
accessToken: token.publicAccessToken,
58+
},
59+
async () => {
60+
await wait.completeToken<Token>(token.id, { status: "approved" });
61+
}
62+
);
63+
} else {
64+
await wait.completeToken<Token>(token.id, { status: "approved" });
65+
}
66+
6867
await wait.for({ seconds: 5 });
6968
} else {
7069
await completeWaitToken.trigger({ token: token.id, delay: completionDelay });

0 commit comments

Comments
 (0)