From 2818208909add27f6d1b9704c2ec8fa0d0b28d5e Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sat, 13 Jun 2026 14:55:07 +0300 Subject: [PATCH] [#7734] removed RedirectURL required validator --- CHANGELOG.md | 6 ++++++ apis/record_auth_with_oauth2.go | 1 - apis/record_auth_with_oauth2_test.go | 10 ++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0056cf58..f527caae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v0.39.4 + +- Removed `redirectURL` required validator from the code->token exchange endpoint (aka. `authWithOAuth2Code()`) ([#7734](https://github.com/pocketbase/pocketbase/issues/7734)). + _Note that the OAuth2 provider has their own validations and whether it is allowed to be empty or not could depend on the configured OAuth2 app (in most cases it is required and the redirect address must match with the initial value submitted with the authorization request)._ + + ## v0.39.3 - Fixed JS error on `file` settings `maxSelect` change ([#7731](https://github.com/pocketbase/pocketbase/issues/7731)). diff --git a/apis/record_auth_with_oauth2.go b/apis/record_auth_with_oauth2.go index 9611ad79..415ef9d2 100644 --- a/apis/record_auth_with_oauth2.go +++ b/apis/record_auth_with_oauth2.go @@ -203,7 +203,6 @@ func (form *recordOAuth2LoginForm) validate() error { return validation.ValidateStruct(form, validation.Field(&form.Provider, validation.Required, validation.Length(0, 100), validation.By(form.checkProviderName)), validation.Field(&form.Code, validation.Required), - validation.Field(&form.RedirectURL, validation.Required), ) } diff --git a/apis/record_auth_with_oauth2_test.go b/apis/record_auth_with_oauth2_test.go index 72357cf1..f6b1fd3a 100644 --- a/apis/record_auth_with_oauth2_test.go +++ b/apis/record_auth_with_oauth2_test.go @@ -90,10 +90,11 @@ func TestRecordAuthWithOAuth2(t *testing.T) { `"data":{`, `"provider":`, `"code":`, - `"redirectURL":`, }, NotExpectedContent: []string{ - `"codeVerifier":`, // should be optional + // should be optional + `"codeVerifier":`, + `"redirectURL":`, }, ExpectedEvents: map[string]int{"*": 0}, }, @@ -109,10 +110,11 @@ func TestRecordAuthWithOAuth2(t *testing.T) { `"data":{`, `"provider":`, `"code":`, - `"redirectURL":`, }, NotExpectedContent: []string{ - `"codeVerifier":`, // should be optional + // should be optional + `"codeVerifier":`, + `"redirectURL":`, }, ExpectedEvents: map[string]int{"*": 0}, },