Skip to content

Commit d6087dc

Browse files
committed
fix: allow for mismatching protocol in trusted domain check - ui warnings
1 parent 6efb970 commit d6087dc

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

frontend/src/lib/hooks/redirect-uri.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@ export const isTrustedDomain = (
114114
return false;
115115
}
116116

117-
if (url.protocol != appUrl.protocol) {
118-
return false;
119-
}
120-
121117
if (getEffectivePort(url) != getEffectivePort(appUrl)) {
122118
return false;
123119
}

internal/controller/oauth_controller.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ func (controller *OAuthController) getCookieDomain() string {
313313

314314
func (controller *OAuthController) isRedirectSafe(redirectURI string) bool {
315315
v := validators.NewDomainValidator(validators.DomainValidatorOptions{
316-
WithScheme: true,
317-
WithPort: true,
316+
WithPort: true,
318317
})
319318

320319
_, err := v.SafeHostname(controller.runtime.AppURL)
@@ -333,7 +332,6 @@ func (controller *OAuthController) isRedirectSafe(redirectURI string) bool {
333332
controller.log.App.Debug().Err(err).Msg("Failed to validate redirect URI")
334333

335334
if errors.Is(err, validators.ErrInvalidURL) ||
336-
errors.Is(err, validators.ErrSchemeMismatch) ||
337335
errors.Is(err, validators.ErrPortMismatch) {
338336
return false
339337
}

0 commit comments

Comments
 (0)