mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-13 13:35:23 +01:00
18 lines
407 B
Go
18 lines
407 B
Go
package authorization
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/notherealmarco/WASAPhoto/service/api/reqcontext"
|
|
)
|
|
|
|
func BuildAuth(header string) (reqcontext.Authorization, error) {
|
|
auth, err := BuildBearer(header)
|
|
if err != nil {
|
|
if err.Error() == "invalid authorization header" {
|
|
return nil, errors.New("method not supported") // todo: better error description
|
|
}
|
|
return nil, err
|
|
}
|
|
return auth, nil
|
|
}
|