This commit is contained in:
Joona Hoikkala 2016-11-21 12:59:35 +02:00
parent c2e19cc6da
commit 47ce432681

2
api.go
View File

@ -29,7 +29,7 @@ func (a AuthMiddleware) Serve(ctx *iris.Context) {
au, err := DB.GetByUsername(username) au, err := DB.GetByUsername(username)
if err == nil && CorrectPassword(password, au.Password) { if err == nil && CorrectPassword(password, au.Password) {
// Password ok // Password ok
if err := ctx.ReadJSON(&postData); err != nil { if err := ctx.ReadJSON(&postData); err == nil {
// Check that the subdomain belongs to the user // Check that the subdomain belongs to the user
if au.Subdomain == postData.Subdomain { if au.Subdomain == postData.Subdomain {
log.Debugf("Accepted authentication from [%s]", usernameStr) log.Debugf("Accepted authentication from [%s]", usernameStr)