From c900a601c33c91ac385849f2f4eeeeb59e458e67 Mon Sep 17 00:00:00 2001 From: Sergey Glazyrin Date: Sun, 7 Nov 2021 10:39:45 +0100 Subject: [PATCH] minor fixes --- blueprint/auth/interfaces/token.go | 4 ++-- blueprint/auth/interfaces/token_with_expiration.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blueprint/auth/interfaces/token.go b/blueprint/auth/interfaces/token.go index 109b5549..adbf6d4d 100644 --- a/blueprint/auth/interfaces/token.go +++ b/blueprint/auth/interfaces/token.go @@ -11,13 +11,13 @@ import ( "net/http" ) -const TOKEN_HEADER_NAME = "AUTH-TOKEN" +const tokenHeaderName = "AUTH-TOKEN" type TokenAuthProvider struct { } func (ap *TokenAuthProvider) GetUserFromRequest(c *gin.Context) core.IUser { - header := c.GetHeader(TOKEN_HEADER_NAME) + header := c.GetHeader(tokenHeaderName) if header == "" { return nil } diff --git a/blueprint/auth/interfaces/token_with_expiration.go b/blueprint/auth/interfaces/token_with_expiration.go index 020ab185..8050e97a 100644 --- a/blueprint/auth/interfaces/token_with_expiration.go +++ b/blueprint/auth/interfaces/token_with_expiration.go @@ -17,7 +17,7 @@ type TokenWithExpirationAuthProvider struct { } func (ap *TokenWithExpirationAuthProvider) GetUserFromRequest(c *gin.Context) core.IUser { - header := c.GetHeader(TOKEN_HEADER_NAME) + header := c.GetHeader(tokenHeaderName) if header == "" { return nil }