use app identifier instead of ctx
changing this because ctx is commonly used with the context package.
This commit is contained in:
@@ -10,14 +10,14 @@ type testReq struct {
|
||||
Password string `json:"jfPassword"`
|
||||
}
|
||||
|
||||
func (ctx *appContext) TestJF(gc *gin.Context) {
|
||||
func (app *appContext) TestJF(gc *gin.Context) {
|
||||
var req testReq
|
||||
gc.BindJSON(&req)
|
||||
tempjf := Jellyfin{}
|
||||
tempjf.init(req.Host, "jfa-go-setup", ctx.version, "auth", "auth")
|
||||
tempjf.init(req.Host, "jfa-go-setup", app.version, "auth", "auth")
|
||||
_, status, err := tempjf.authenticate(req.Username, req.Password)
|
||||
if !(status == 200 || status == 204) || err != nil {
|
||||
ctx.info.Printf("Auth failed with code %d (%s)", status, err)
|
||||
app.info.Printf("Auth failed with code %d (%s)", status, err)
|
||||
gc.JSON(401, map[string]bool{"success": false})
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user