File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1111 ]"
1212 >
1313 <div v-html =" provider.icon" class =" w-6 h-6 dark:text-white" :class =" meta.iconOnly ? 'mr-0' : 'mr-4'" :alt =" getProviderName(provider.provider)" />
14- <span v-if =" !meta.iconOnly" class =" font-medium dark:text-white" >Continue with {{ getProviderName (provider.provider ) }}</span >
14+ <span v-if =" !meta.iconOnly" class =" font-medium dark:text-white" >{{ getButtonText (provider.buttonText ) }}</span >
1515 </a >
1616 </div >
1717</template >
@@ -27,6 +27,9 @@ const props = defineProps({
2727const getProviderName = (provider ) => {
2828 return provider .replace (' AdminForthAdapter' , ' ' ).replace (' Oauth2' , ' ' );
2929};
30+ const getButtonText = (buttonText ) => {
31+ return buttonText .replace (' AdminForthAdapter' , ' ' ).replace (' Oauth2' , ' ' );
32+ };
3033
3134const handleLogin = (authUrl ) => {
3235 const baseUrl = props .meta .baseUrl ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ interface OAuthPluginOptions {
1010 emailField : string ;
1111 emailConfirmedField ?: string ;
1212 adapters : OAuth2Adapter [ ] ;
13+ buttonText ?: string ;
1314 iconOnly ?: boolean ;
1415 pill ?: boolean ;
1516 authenticationExpireDuration ?: number ;
@@ -82,7 +83,7 @@ export default class OAuthPlugin extends AdminForthPlugin {
8283 loginPageInjections : { underInputs : [ ] }
8384 } ;
8485 }
85-
86+
8687 // Register the component with the correct plugin path
8788 const componentPath = `@@/plugins/${ this . constructor . name } /OAuthLoginButtons.vue` ;
8889 this . componentPath ( 'OAuthLoginButtons.vue' ) ;
@@ -91,11 +92,11 @@ export default class OAuthPlugin extends AdminForthPlugin {
9192 const state = Buffer . from ( JSON . stringify ( {
9293 provider : adapter . constructor . name
9394 } ) ) . toString ( 'base64' ) ;
94-
9595 return {
9696 authUrl : `${ adapter . getAuthUrl ( ) } &state=${ state } ` ,
9797 provider : adapter . constructor . name ,
9898 icon : adapter . getIcon ( ) ,
99+ buttonText : `${ this . options . buttonText ? this . options . buttonText : 'Continue with' } ${ ( adapter . getName ? adapter . getName ( ) : adapter . constructor . name ) } ` ,
99100 } ;
100101 } ) ;
101102
You can’t perform that action at this time.
0 commit comments