Skip to content

Commit

Permalink
fix(conflicts): patch up conflicts from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusted committed May 25, 2021
1 parent aac127a commit 70a0535
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion handlers/jwt/jwtware.go
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/gofiber/fiber/v2"

"userstyles.world/config"
"userstyles.world/modules/errors"
)

var (
Expand Down
1 change: 0 additions & 1 deletion handlers/server.go
Expand Up @@ -106,7 +106,6 @@ func Initialize() {
app.Get("/logout", jwtware.Protected, user.Logout)
app.Get("/account", jwtware.Protected, user.Account)
app.Post("/account", jwtware.Protected, user.EditAccount)
app.Post("/style/:id", jwtware.Protected, style.DeleteByID)
app.Get("/add", jwtware.Protected, style.CreateGet)
app.Post("/add", jwtware.Protected, style.CreatePost)
app.Get("/delete/:id", jwt.Protected, style.DeleteGet)
Expand Down
2 changes: 1 addition & 1 deletion models/user.go
Expand Up @@ -121,7 +121,7 @@ func FindUserByID(db *gorm.DB, id string) (*User, error) {
}

if user.ID == 0 {
return nil, errors.New("user not found")
return nil, errors.UserNotFound
}

return user, nil
Expand Down
3 changes: 2 additions & 1 deletion utils/chacha20poly1305.go
Expand Up @@ -2,6 +2,7 @@ package utils

import (
"crypto/cipher"
"fmt"

"github.com/form3tech-oss/jwt-go"
"golang.org/x/crypto/chacha20poly1305"
Expand Down Expand Up @@ -60,7 +61,7 @@ func OpenText(encryptedMsg string, aead cipher.AEAD) ([]byte, error) {
}

func VerifyJwtKeyFunction(t *jwt.Token) (interface{}, error) {
if t.Method.Alg() != verifySigningMethod {
if t.Method.Alg() != signingMethod {
return nil, errors.UnexpectedSigningMethod(t.Method.Alg())
}
return VerifySigningKey, nil
Expand Down

0 comments on commit 70a0535

Please sign in to comment.