Add admin session only via http cookies

This commit is contained in:
Lakhan Samani 2022-01-09 17:40:08 +05:30
parent 9d08d6c672
commit 047e867faa

View File

@ -133,13 +133,6 @@ func CreateAdminAuthToken(tokenType enum.TokenType, c *gin.Context) (string, err
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 ")
return "", fmt.Errorf("unauthorized")
}