mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-08 23:37:28 +02:00
[#7815] added checks for missing providers prop
This commit is contained in:
1 parent
da18302785
commit
bc8ffed4e7
2 files changed
+64
-28
No files matched your search
@@ -442,6 +442,11 @@ func (c *OAuth2Config) UnmarshalJSON(b []byte) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// no providers were submitted
|
||||
if len(plain.Providers) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(c.Providers) != len(plain.Providers) {
|
||||
return errors.New("the length of the plain unmarshalized providers and the ones from the config doesn't match")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user