timoth-y/kicksware-api

View on GitHub
shared/api/gRPC/authClientInterceptor.go

Summary

Maintainability
A
35 mins
Test Coverage

Method AuthClientInterceptor.requestAccessToken has 5 return statements (exceeds 4 allowed).
Open

func (i *AuthClientInterceptor) requestAccessToken(ctx context.Context) (*meta.AuthToken, error) {
    if i.accessToken != nil {
        if !i.accessToken.Expires.IsZero() && i.accessToken.Expires.Nanosecond() <= time.Now().Nanosecond() {
            newToken, err := i.authClient.Refresh(ctx, proto.AuthToken{}.FromNative(i.accessToken)); if err == nil {
                i.accessToken = newToken.ToNative()
Severity: Major
Found in shared/api/gRPC/authClientInterceptor.go - About 35 mins to fix

    There are no issues that match your filters.

    Category
    Status