hotfixes for repo. Now works.

This commit is contained in:
afeiszli
2021-03-25 22:29:36 -04:00
parent 6343207ea5
commit e489a18492
25 changed files with 232 additions and 757 deletions

View File

@@ -129,7 +129,12 @@ func authorizeUser(next http.Handler) http.HandlerFunc {
if len(tokenSplit) > 1 {
authToken = tokenSplit[1]
}
} else {
errorResponse = models.ErrorResponse{
Code: http.StatusUnauthorized, Message: "W1R3: Missing Auth Token.",
}
returnErrorResponse(w, r, errorResponse)
}
//This checks if
//A: the token is the master password
@@ -138,8 +143,10 @@ func authorizeUser(next http.Handler) http.HandlerFunc {
username, _, err := functions.VerifyUserToken(authToken)
if err != nil {
json.NewEncoder(w).Encode(err)
return
errorResponse = models.ErrorResponse{
Code: http.StatusUnauthorized, Message: "W1R3: Error Verifying Auth Token.",
}
returnErrorResponse(w, r, errorResponse)
}
isAuthorized := username != ""