Skip to content

Commit 04ccfa4

Browse files
committed
fix relative path resolution and bad auth retry
1 parent c4d5667 commit 04ccfa4

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

auth.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ export function createTrpcClient(debug: boolean, deployUrl: string) {
6262
errorLink,
6363
retryLink({
6464
retry({ error: err }) {
65-
const code = err?.data?.code;
65+
const code = err?.data?.code ?? err?.cause?.data?.code;
6666
if (!(code === "NOT_AUTHENTICATED" || code === "TOKEN_EXPIRED")) {
67-
return false;
6867
}
6968

7069
if (tokenIsTemp) {
@@ -105,7 +104,6 @@ export function createTrpcClient(debug: boolean, deployUrl: string) {
105104
});
106105
} else if (response.status === 403) {
107106
const body = await response.clone().json();
108-
console.log(body);
109107
if (body.code === "TOKEN_EXPIRED") {
110108
throw TRPCClientError.from({
111109
message: "Token Expired",

config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fromFileUrl, join } from "@std/path";
1+
import { fromFileUrl, join, resolve } from "@std/path";
22
import {
33
applyEdits as applyJSONCEdits,
44
modify as modifyJSONC,
@@ -18,6 +18,7 @@ export async function readConfig(
1818
rootPath: string,
1919
maybeConfigPath: string | undefined,
2020
): Promise<Config | null> {
21+
rootPath = resolve(rootPath);
2122
if (maybeConfigPath) {
2223
const content = await Deno.readTextFile(maybeConfigPath);
2324
return { path: maybeConfigPath, content };

0 commit comments

Comments
 (0)