0.3.33
This commit is contained in:
@@ -284,6 +284,12 @@ func (s *Server) handleInstallLogin(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Gateway, not a television: this sign-in is the admin console or the web installer
|
||||
// checking a password, so Emby records it under the gateway's own client name.
|
||||
log := s.loggerFor(r.Context()).With(
|
||||
"emby_client", s.cfg.GatewayClientName,
|
||||
"device", s.installerDeviceName(),
|
||||
"device_id", installerDeviceID,
|
||||
)
|
||||
log.Info("Emby installer authentication starting")
|
||||
auth, err := s.emby.Authenticate(
|
||||
r.Context(), username, password,
|
||||
emby.Credentials{
|
||||
@@ -291,10 +297,11 @@ func (s *Server) handleInstallLogin(w http.ResponseWriter, r *http.Request) {
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
s.loggerFor(r.Context()).Warn("installer Emby authentication failed", "username", username)
|
||||
log.Warn("installer Emby authentication failed", "username", username)
|
||||
s.renderAccessLogin(w, r, "Sign-in failed.", http.StatusUnauthorized, next)
|
||||
return
|
||||
}
|
||||
log.Info("Emby installer authentication succeeded", "username", username, "user_id", auth.User.ID)
|
||||
// Ask before the token is retired below: the fallback lookup needs it. Whether the
|
||||
// answer is wanted depends on where the sign-in was headed, but it is asked either way
|
||||
// so that the cleanup underneath runs on one path rather than two.
|
||||
|
||||
Reference in New Issue
Block a user