Skip to content

Commit 6ebc907

Browse files
committed
fix(NextcloudBookmarks): Improve ticket failure retry mechanism
Signed-off-by: Marcel Klehr <[email protected]>
1 parent 1304f20 commit 6ebc907

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/lib/adapters/NextcloudBookmarks.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -886,16 +886,17 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
886886
throw new RedirectError()
887887
}
888888

889+
if (res.status > 400 && res.status !== 423 && authString.startsWith('Bearer')) {
890+
this.ticket = null
891+
this.ticketTimestamp = 0
892+
return this.sendRequest(verb, url, type, body, returnRawResponse, headers)
893+
}
894+
889895
if (returnRawResponse) {
890896
return res
891897
}
892898

893899
if (res.status === 401 || res.status === 403) {
894-
if (authString.startsWith('Bearer')) {
895-
this.ticket = null
896-
this.ticketTimestamp = 0
897-
return this.sendRequest(verb, url, type, body, returnRawResponse, headers)
898-
}
899900
throw new AuthenticationError()
900901
}
901902
if (res.status === 503 || res.status >= 400) {
@@ -1002,16 +1003,17 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
10021003
throw new RedirectError()
10031004
}
10041005

1006+
if (res.status > 400 && res.status !== 423 && authString.startsWith('Bearer')) {
1007+
this.ticket = null
1008+
this.ticketTimestamp = 0
1009+
return this.sendRequestNative(verb, url, type, body, returnRawResponse, headers)
1010+
}
1011+
10051012
if (returnRawResponse) {
10061013
return res
10071014
}
10081015

10091016
if (res.status === 401 || res.status === 403) {
1010-
if (authString.startsWith('Bearer')) {
1011-
this.ticket = null
1012-
this.ticketTimestamp = 0
1013-
return this.sendRequestNative(verb, url, type, body, returnRawResponse, headers)
1014-
}
10151017
throw new AuthenticationError()
10161018
}
10171019
if (res.status === 503 || res.status >= 400) {

0 commit comments

Comments
 (0)