File tree Expand file tree Collapse file tree 5 files changed +21
-2
lines changed Expand file tree Collapse file tree 5 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ var uiConfig = {
47
47
firebase . auth . EmailAuthProvider . PROVIDER_ID
48
48
] ,
49
49
// Terms of service url.
50
- 'tosUrl' : 'https://www.google.com'
50
+ 'tosUrl' : 'https://www.google.com' ,
51
+ 'shouldDisplayName' : false
51
52
} ;
52
53
53
54
// Initialize the FirebaseUI Widget using Firebase.
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ goog.require('firebaseui.auth.ui.page.Base');
31
31
/**
32
32
* Password sign-up UI component.
33
33
* @param {?string } tosUrl The ToS URL.
34
+ * @param {bool } showDisplayName Whether to show the display name.
34
35
* @param {function() } onSubmitClick Callback to invoke when the submit button
35
36
* is clicked.
36
37
* @param {function()= } opt_onCancelClick Callback to invoke when the cancel
@@ -43,6 +44,7 @@ goog.require('firebaseui.auth.ui.page.Base');
43
44
*/
44
45
firebaseui . auth . ui . page . PasswordSignUp = function (
45
46
tosUrl ,
47
+ showDisplayName ,
46
48
onSubmitClick ,
47
49
opt_onCancelClick ,
48
50
opt_email ,
@@ -54,6 +56,7 @@ firebaseui.auth.ui.page.PasswordSignUp = function(
54
56
firebaseui . auth . soy2 . page . passwordSignUp ,
55
57
{
56
58
email : opt_email ,
59
+ showDisplayName : showDisplayName ,
57
60
name : opt_name ,
58
61
tosUrl : tosUrl ,
59
62
allowCancel : ! ! opt_onCancelClick
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ firebaseui.auth.widget.Config = function() {
68
68
this . config_ . define ( 'siteName' ) ;
69
69
this . config_ . define ( 'tosUrl' ) ;
70
70
this . config_ . define ( 'widgetUrl' ) ;
71
+ /**
72
+ * Determines whether the user is asked for entering display name
73
+ * while going through the email/password signup flow.
74
+ */
75
+ this . config_ . define ( 'shouldDisplayName' , true ) ;
71
76
} ;
72
77
73
78
@@ -290,6 +295,12 @@ firebaseui.auth.widget.Config.prototype.getTosUrl = function() {
290
295
} ;
291
296
292
297
298
+ /** @return {bool } Whether the display name should be displayed. */
299
+ firebaseui . auth . widget . Config . prototype . getShouldDisplayName = function ( ) {
300
+ return /** @type {bool } */ ( this . config_ . get ( 'shouldDisplayName' ) ) ;
301
+ } ;
302
+
303
+
293
304
/** @return {boolean } Whether to prefer popup mode. */
294
305
firebaseui . auth . widget . Config . prototype . getPopupMode = function ( ) {
295
306
return ! ! this . config_ . get ( 'popupMode' ) ;
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ firebaseui.auth.widget.handler.handlePasswordSignUp = function(
48
48
// Render the UI.
49
49
var component = new firebaseui . auth . ui . page . PasswordSignUp (
50
50
app . getConfig ( ) . getTosUrl ( ) ,
51
+ app . getConfig ( ) . getShouldDisplayName ( ) ,
51
52
// On submit.
52
53
function ( ) {
53
54
firebaseui . auth . widget . handler . onSignUpSubmit_ ( app , component ) ;
Original file line number Diff line number Diff line change 76
76
*/
77
77
{template .passwordSignUp }
78
78
{@param ? email: string } /** The email address to prefill. */
79
+ {@param ? showDisplayName: bool } /** Whether to show the display name. */
79
80
{@param ? name: string } /** The name to prefill. */
80
81
{@param ? tosUrl: string } /** The Terms of Service URL. */
81
82
{@param ? allowCancel: bool } /** Whether to show the cancel link. */
89
90
</div >
90
91
<div class =" {css firebaseui- card- content}" >
91
92
{call firebaseui.auth.soy2.element.email data ="all" /}
92
- {call firebaseui.auth.soy2.element.name data ="all" /}
93
+ {if $showDisplayName }
94
+ {call firebaseui.auth.soy2.element.name data ="all" /}
95
+ {/if }
93
96
{call firebaseui.auth.soy2.element.newPassword }
94
97
{param choose: true /}
95
98
{/call }
You can’t perform that action at this time.
0 commit comments