Add _admin_signup mutation

This commit is contained in:
Lakhan Samani
2022-01-09 17:35:37 +05:30
parent 91c35aa381
commit 9d08d6c672
24 changed files with 297 additions and 66 deletions

View File

@@ -134,13 +134,13 @@ func GetAdminAuthToken(gc *gin.Context) (string, error) {
token, err := GetAdminCookie(gc)
if err != nil || token == "" {
// try to check in auth header for cookie
auth := gc.Request.Header.Get("Authorization")
if auth == "" {
return "", fmt.Errorf(`unauthorized`)
}
token = strings.TrimPrefix(auth, "Bearer ")
// auth := gc.Request.Header.Get("Authorization")
// if auth == "" {
// return "", fmt.Errorf(`unauthorized`)
// }
// token = strings.TrimPrefix(auth, "Bearer ")
return "", fmt.Errorf("unauthorized")
}
// cookie escapes special characters like $