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 11
11
]"
12
12
>
13
13
<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 >
15
15
</a >
16
16
</div >
17
17
</template >
@@ -27,6 +27,9 @@ const props = defineProps({
27
27
const getProviderName = (provider ) => {
28
28
return provider .replace (' AdminForthAdapter' , ' ' ).replace (' Oauth2' , ' ' );
29
29
};
30
+ const getButtonText = (buttonText ) => {
31
+ return buttonText .replace (' AdminForthAdapter' , ' ' ).replace (' Oauth2' , ' ' );
32
+ };
30
33
31
34
const handleLogin = (authUrl ) => {
32
35
const baseUrl = props .meta .baseUrl ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ interface OAuthPluginOptions {
10
10
emailField : string ;
11
11
emailConfirmedField ?: string ;
12
12
adapters : OAuth2Adapter [ ] ;
13
+ buttonText ?: string ;
13
14
iconOnly ?: boolean ;
14
15
pill ?: boolean ;
15
16
authenticationExpireDuration ?: number ;
@@ -82,7 +83,7 @@ export default class OAuthPlugin extends AdminForthPlugin {
82
83
loginPageInjections : { underInputs : [ ] }
83
84
} ;
84
85
}
85
-
86
+
86
87
// Register the component with the correct plugin path
87
88
const componentPath = `@@/plugins/${ this . constructor . name } /OAuthLoginButtons.vue` ;
88
89
this . componentPath ( 'OAuthLoginButtons.vue' ) ;
@@ -91,11 +92,11 @@ export default class OAuthPlugin extends AdminForthPlugin {
91
92
const state = Buffer . from ( JSON . stringify ( {
92
93
provider : adapter . constructor . name
93
94
} ) ) . toString ( 'base64' ) ;
94
-
95
95
return {
96
96
authUrl : `${ adapter . getAuthUrl ( ) } &state=${ state } ` ,
97
97
provider : adapter . constructor . name ,
98
98
icon : adapter . getIcon ( ) ,
99
+ buttonText : `${ this . options . buttonText ? this . options . buttonText : 'Continue with' } ${ ( adapter . getName ? adapter . getName ( ) : adapter . constructor . name ) } ` ,
99
100
} ;
100
101
} ) ;
101
102
You can’t perform that action at this time.
0 commit comments