This commit is contained in:
Joona Hoikkala
2016-11-23 22:12:43 +02:00
parent c2e19cc6da
commit 47ce432681
+1 -1
View File
@@ -29,7 +29,7 @@ func (a AuthMiddleware) Serve(ctx *iris.Context) {
au, err := DB.GetByUsername(username)
if err == nil && CorrectPassword(password, au.Password) {
// Password ok
if err := ctx.ReadJSON(&postData); err != nil {
if err := ctx.ReadJSON(&postData); err == nil {
// Check that the subdomain belongs to the user
if au.Subdomain == postData.Subdomain {
log.Debugf("Accepted authentication from [%s]", usernameStr)