Feat rebrand armature (#43)
All checks were successful
All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #43.
This commit is contained in:
@@ -11,9 +11,9 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
|
||||
"switchboard-core/config"
|
||||
"switchboard-core/database"
|
||||
"switchboard-core/store"
|
||||
"armature/config"
|
||||
"armature/database"
|
||||
"armature/store"
|
||||
)
|
||||
|
||||
// Claims represents the JWT payload. Must match handlers.Claims.
|
||||
@@ -142,11 +142,11 @@ func parseAndValidateJWT(tokenString string, jwtSecret string) (*Claims, bool) {
|
||||
return claims, true
|
||||
}
|
||||
|
||||
// UserIDFromCookie extracts the user ID from the sb_token cookie without
|
||||
// UserIDFromCookie extracts the user ID from the arm_token cookie without
|
||||
// requiring authentication. Returns "" if no valid token is found.
|
||||
// Used by unauthenticated routes that want optional user context.
|
||||
func UserIDFromCookie(c *gin.Context, jwtSecret string) string {
|
||||
cookie, err := c.Cookie("sb_token")
|
||||
cookie, err := c.Cookie("arm_token")
|
||||
if err != nil || cookie == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user