File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " payload-oauth2" ,
3- "version" : " 1.0.17 " ,
3+ "version" : " 1.0.18 " ,
44 "type" : " module" ,
55 "homepage:" : " https://github.com/WilsonLe/payload-oauth2" ,
66 "repository" : " https://github.com/WilsonLe/payload-oauth2" ,
Original file line number Diff line number Diff line change @@ -19,16 +19,20 @@ export const modifyAuthCollection = (
1919 ( field ) => "name" in field && field . name === subFieldName ,
2020 ) ;
2121 if ( ! existingSubField ) {
22- fields . push ( {
23- name : subFieldName ,
24- type : "text" ,
25- index : true ,
26- access : {
27- read : ( ) => true ,
28- create : ( ) => true ,
29- update : ( ) => false ,
30- } ,
31- } ) ;
22+ if ( ! ! pluginOptions . subField ) {
23+ fields . push ( pluginOptions . subField ) ;
24+ } else {
25+ fields . push ( {
26+ name : subFieldName ,
27+ type : "text" ,
28+ index : true ,
29+ access : {
30+ read : ( ) => true ,
31+ create : ( ) => true ,
32+ update : ( ) => false ,
33+ } ,
34+ } ) ;
35+ }
3236 }
3337
3438 // add email field if disableLocalStrategy is set
You can’t perform that action at this time.
0 commit comments