@@ -18,6 +18,7 @@ interface OAuthPluginOptions {
1818 enabled ?: boolean ;
1919 defaultFieldValues ?: Record < string , any > ;
2020 } ;
21+ componentsOrderUnderLoginButton ?: number ;
2122}
2223
2324export default class OAuthPlugin extends AdminForthPlugin {
@@ -43,9 +44,9 @@ export default class OAuthPlugin extends AdminForthPlugin {
4344 } ;
4445 }
4546
46- async modifyResourceConfig ( adminforth : IAdminForth , resource : AdminForthResource ) {
47- await super . modifyResourceConfig ( adminforth , resource ) ;
48-
47+ modifyResourceConfig ( adminforth : IAdminForth , resource : AdminForthResource ) {
48+ super . modifyResourceConfig ( adminforth , resource ) ;
49+
4950 this . adminforth = adminforth ;
5051 this . resource = resource ;
5152 adminforth . config . customization . customPages . push ( {
@@ -80,7 +81,7 @@ export default class OAuthPlugin extends AdminForthPlugin {
8081 if ( ! adminforth . config . customization ?. loginPageInjections ) {
8182 adminforth . config . customization = {
8283 ...adminforth . config . customization ,
83- loginPageInjections : { underInputs : [ ] , panelHeader : [ ] }
84+ loginPageInjections : { underInputs : [ ] , underLoginButton : [ ] , panelHeader : [ ] }
8485 } ;
8586 }
8687
@@ -99,10 +100,10 @@ export default class OAuthPlugin extends AdminForthPlugin {
99100 buttonText : `${ this . options . buttonText ? this . options . buttonText : 'Continue with' } ${ ( adapter . getName ? adapter . getName ( ) : adapter . constructor . name ) } ` ,
100101 } ;
101102 } ) ;
102-
103- adminforth . config . customization . loginPageInjections . underInputs . push ( {
103+ ( adminforth . config . customization . loginPageInjections . underLoginButton as Array < any > ) . push ( {
104104 file : componentPath ,
105105 meta : {
106+ afOrder : this . options . componentsOrderUnderLoginButton || 0 ,
106107 providers,
107108 iconOnly : this . options . iconOnly ,
108109 pill : this . options . pill ,
@@ -134,9 +135,7 @@ export default class OAuthPlugin extends AdminForthPlugin {
134135 username,
135136 } ;
136137 const toReturn = { allowedLogin : true , error : '' } ;
137-
138138 await this . adminforth . restApi . processLoginCallbacks ( adminUser , toReturn , response , extra ) ;
139-
140139 if ( toReturn . allowedLogin ) {
141140 this . adminforth . auth . setAuthCookie ( {
142141 response,
@@ -145,7 +144,6 @@ export default class OAuthPlugin extends AdminForthPlugin {
145144 expireInDays : this . options . authenticationExpireDuration ? this . options . authenticationExpireDuration : this . adminforth . config . auth . rememberMeDays
146145 } ) ;
147146 }
148-
149147 return toReturn ;
150148 }
151149
0 commit comments