// Token returns the token from the request header or query.
Token returns the token from the request header or query.
// Token returns the token from the request header or query .
func Token(c *gin.Context) string {
	token := c.GetHeader("Authorization")
	splits := strings.SplitN(strings.TrimSpace(token), " ", 2)
	if len(splits) == 2 {
		return splits[1]
	}
	return c.Query("token")
}
func Token ( c * gin . Context ) string { token := c . GetHeader ( " " ) splits := strings . SplitN ( strings . TrimSpace ( token ) , " " , 2 ) if len ( splits ) == 2 { return splits [ 1 ] } return c . Query ( " " ) }
Token returns the token from the request header or query.
Token returns the token from the request header or query .