Add resolver to update profile

Resolves #12 #11
This commit is contained in:
Lakhan Samani
2021-07-18 09:25:20 +05:30
parent 83b3149c0b
commit 7d17032fc2
14 changed files with 460 additions and 246 deletions

View File

@@ -1,7 +1,7 @@
package utils
import (
"errors"
"fmt"
"log"
"strings"
"time"
@@ -56,7 +56,7 @@ func GetAuthToken(gc *gin.Context) (string, error) {
log.Println("cookie not found checking headers")
auth := gc.Request.Header.Get("Authorization")
if auth == "" {
return "", errors.New(`Unauthorized`)
return "", fmt.Errorf(`Unauthorized`)
}
token = strings.TrimPrefix(auth, "Bearer ")