package api

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func (api *API) TokenAuth() gin.HandlerFunc {
	return func(c *gin.Context) {
		if api.token != c.Request.Header.Get("Authorization") {
			c.AbortWithStatus(http.StatusUnauthorized)
			return
		}
	}
}

package api

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func (api *API) TokenAuth() gin.HandlerFunc {
	return func(c *gin.Context) {
		if api.token != c.Request.Header.Get("token") {
			c.AbortWithStatus(http.StatusUnauthorized)
			return
		}
	}
}

--- 
+++ 
@@ -8,7 +8,7 @@
 
 func (api *API) TokenAuth() gin.HandlerFunc {
 	return func(c *gin.Context) {
-		if api.token != c.Request.Header.Get("token") {
+		if api.token != c.Request.Header.Get("Authorization") {
 			c.AbortWithStatus(http.StatusUnauthorized)
 			return
 		}
Rename auth header to Authorization
