mirror of
https://github.com/openziti/zrok.git
synced 2025-08-18 11:49:51 +02:00
richer principal (#11)
This commit is contained in:
@@ -19,7 +19,11 @@ func ZrokAuthenticate(token string) (*rest_model_zrok.Principal, error) {
|
||||
return nil, err
|
||||
}
|
||||
if a, err := Str.FindAccountWithToken(token, tx); err == nil {
|
||||
principal := rest_model_zrok.Principal(a.Token)
|
||||
principal := rest_model_zrok.Principal{
|
||||
ID: int64(a.Id),
|
||||
Token: a.Token,
|
||||
Username: a.Username,
|
||||
}
|
||||
return &principal, nil
|
||||
} else {
|
||||
return nil, errors2.New(401, "invalid api key")
|
||||
|
Reference in New Issue
Block a user