mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 14:52:05 +01:00
Optionally allow basic auth fallback for chapter page endpoint (#1757)
Requesting a chapter page while having a non basic auth mode (e.g. ui login) enabled caused the basic auth prompt. However, this is only supposed to be happen for opds
This commit is contained in:
@@ -457,6 +457,7 @@ object MangaController {
|
|||||||
pathParam<Int>("index"),
|
pathParam<Int>("index"),
|
||||||
queryParam<Boolean?>("updateProgress"),
|
queryParam<Boolean?>("updateProgress"),
|
||||||
queryParam<String?>("format"),
|
queryParam<String?>("format"),
|
||||||
|
queryParam<Boolean?>("opds"),
|
||||||
documentWith = {
|
documentWith = {
|
||||||
withOperation {
|
withOperation {
|
||||||
summary("Get a chapter page")
|
summary("Get a chapter page")
|
||||||
@@ -465,8 +466,13 @@ object MangaController {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
behaviorOf = { ctx, mangaId, chapterIndex, index, updateProgress, format ->
|
behaviorOf = { ctx, mangaId, chapterIndex, index, updateProgress, format, opds ->
|
||||||
|
if (opds == true) {
|
||||||
ctx.getAttribute(Attribute.TachideskUser).requireUserWithBasicFallback(ctx)
|
ctx.getAttribute(Attribute.TachideskUser).requireUserWithBasicFallback(ctx)
|
||||||
|
} else {
|
||||||
|
ctx.getAttribute(Attribute.TachideskUser).requireUser()
|
||||||
|
}
|
||||||
|
|
||||||
ctx.future {
|
ctx.future {
|
||||||
future {
|
future {
|
||||||
Page.getPageImage(
|
Page.getPageImage(
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ object OpdsEntryBuilder {
|
|||||||
if (chapter.pageCount > 0) {
|
if (chapter.pageCount > 0) {
|
||||||
val basePageHref =
|
val basePageHref =
|
||||||
"/api/v1/manga/${manga.id}/chapter/${chapter.sourceOrder}/page/{pageNumber}" +
|
"/api/v1/manga/${manga.id}/chapter/${chapter.sourceOrder}/page/{pageNumber}" +
|
||||||
"?updateProgress=${serverConfig.opdsEnablePageReadProgress.value}"
|
"?updateProgress=${serverConfig.opdsEnablePageReadProgress.value}&opds=true"
|
||||||
|
|
||||||
val title: String =
|
val title: String =
|
||||||
when {
|
when {
|
||||||
|
|||||||
Reference in New Issue
Block a user