A little bit more of token handling
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
This commit is contained in:
@@ -55,7 +55,7 @@ func (srv *TokensServer) CreateToken(ctx context.Context, in *tokens.CreateToken
|
||||
Scopes: permissions,
|
||||
}
|
||||
|
||||
token, _, err := srv.tokenCtrl.Create(ctx, tokenData)
|
||||
token, tokenID, err := srv.tokenCtrl.Create(ctx, tokenData)
|
||||
if err != nil {
|
||||
if errors.Is(err, controllers.ErrServerError) {
|
||||
return nil, status.Error(codes.Internal, "Something is broken on our side")
|
||||
@@ -64,6 +64,9 @@ func (srv *TokensServer) CreateToken(ctx context.Context, in *tokens.CreateToken
|
||||
}
|
||||
|
||||
return &tokens.CreateTokenResponse{
|
||||
TokenUuid: &tokens.TokenUUID{
|
||||
Uuid: tokenID,
|
||||
},
|
||||
TokenValue: &tokens.TokenValue{Token: token},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user