-
This commit is contained in:
@ -48,8 +48,8 @@ func (r *ApplicationRepository) Create(ctx context.Context, app *domain.Applicat
|
||||
pq.Array(typeStrings),
|
||||
app.CallbackURL,
|
||||
app.HMACKey,
|
||||
app.TokenRenewalDuration.Nanoseconds(),
|
||||
app.MaxTokenDuration.Nanoseconds(),
|
||||
app.TokenRenewalDuration.Duration.Nanoseconds(),
|
||||
app.MaxTokenDuration.Duration.Nanoseconds(),
|
||||
string(app.Owner.Type),
|
||||
app.Owner.Name,
|
||||
app.Owner.Owner,
|
||||
@ -118,8 +118,8 @@ func (r *ApplicationRepository) GetByID(ctx context.Context, appID string) (*dom
|
||||
}
|
||||
|
||||
// Convert nanoseconds to duration
|
||||
app.TokenRenewalDuration = time.Duration(tokenRenewalNanos)
|
||||
app.MaxTokenDuration = time.Duration(maxTokenNanos)
|
||||
app.TokenRenewalDuration = domain.Duration{Duration: time.Duration(tokenRenewalNanos)}
|
||||
app.MaxTokenDuration = domain.Duration{Duration: time.Duration(maxTokenNanos)}
|
||||
|
||||
// Convert owner type
|
||||
app.Owner.Type = domain.OwnerType(ownerType)
|
||||
@ -180,8 +180,8 @@ func (r *ApplicationRepository) List(ctx context.Context, limit, offset int) ([]
|
||||
}
|
||||
|
||||
// Convert nanoseconds to duration
|
||||
app.TokenRenewalDuration = time.Duration(tokenRenewalNanos)
|
||||
app.MaxTokenDuration = time.Duration(maxTokenNanos)
|
||||
app.TokenRenewalDuration = domain.Duration{Duration: time.Duration(tokenRenewalNanos)}
|
||||
app.MaxTokenDuration = domain.Duration{Duration: time.Duration(maxTokenNanos)}
|
||||
|
||||
// Convert owner type
|
||||
app.Owner.Type = domain.OwnerType(ownerType)
|
||||
@ -233,13 +233,13 @@ func (r *ApplicationRepository) Update(ctx context.Context, appID string, update
|
||||
|
||||
if updates.TokenRenewalDuration != nil {
|
||||
setParts = append(setParts, fmt.Sprintf("token_renewal_duration = $%d", argIndex))
|
||||
args = append(args, updates.TokenRenewalDuration.Nanoseconds())
|
||||
args = append(args, updates.TokenRenewalDuration.Duration.Nanoseconds())
|
||||
argIndex++
|
||||
}
|
||||
|
||||
if updates.MaxTokenDuration != nil {
|
||||
setParts = append(setParts, fmt.Sprintf("max_token_duration = $%d", argIndex))
|
||||
args = append(args, updates.MaxTokenDuration.Nanoseconds())
|
||||
args = append(args, updates.MaxTokenDuration.Duration.Nanoseconds())
|
||||
argIndex++
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user