mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-14 17:45:36 +00:00
14 lines
210 B
Go
14 lines
210 B
Go
package auth
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func ParseBearerToken(token string) (string, error) {
|
|
if !strings.HasPrefix(token, "Bearer ") {
|
|
return "", fmt.Errorf("invalid token")
|
|
}
|
|
return token[7:], nil
|
|
}
|