Refactor irc client (#19)

* refactor: update http handlers

* feat: add trace log level

* refactir: irc handler

* refactor(definitions): add irc settings and invite cmd:

* feat: add dft values to inputs

* refactor: indexer irc forms

* refactor(definitions): fix nickserv.password var:

* feat: pre fill indexer name field

* refactor: handle stopping and updates
This commit is contained in:
Ludvig Lundgren 2021-08-29 23:23:02 +02:00 committed by GitHub
parent 5f69ae9380
commit 4d40d41628
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 1380 additions and 943 deletions

View file

@ -16,8 +16,15 @@ type authService interface {
}
type authHandler struct {
encoder encoder
authService authService
encoder encoder
service authService
}
func newAuthHandler(encoder encoder, service authService) *authHandler {
return &authHandler{
encoder: encoder,
service: service,
}
}
var (
@ -49,7 +56,7 @@ func (h authHandler) login(w http.ResponseWriter, r *http.Request) {
store.Options.SameSite = http.SameSiteStrictMode
session, _ := store.Get(r, "user_session")
_, err := h.authService.Login(data.Username, data.Password)
_, err := h.service.Login(data.Username, data.Password)
if err != nil {
h.encoder.StatusResponse(ctx, w, nil, http.StatusUnauthorized)
return