Skip to content

Commit e154c5b

Browse files
authored
providerName should default to providerId if not provided (#579)
1 parent 149a9eb commit e154c5b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

javascript/widgets/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ firebaseui.auth.widget.Config.prototype.getProviderConfigs = function() {
386386
} else {
387387
return {
388388
providerId: option['provider'],
389-
providerName: option['providerName'] || null,
389+
// ProviderName should default to providerId if not provided.
390+
providerName: option['providerName'] || option['provider'],
390391
buttonColor: option['buttonColor'] || null,
391392
iconUrl: option['iconUrl'] ?
392393
firebaseui.auth.util.sanitizeUrl(option['iconUrl']) : null,

javascript/widgets/config_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ function testGetProviderConfigs() {
284284
{'not a': 'valid config'},
285285
{
286286
'provider': 'yahoo.com',
287-
'providerName': 'Yahoo',
288287
'buttonColor': '#FFB6C1',
289288
'iconUrl': '<url-of-the-icon-of-the-sign-in-button>'
290289
}
@@ -306,7 +305,8 @@ function testGetProviderConfigs() {
306305
}, providerConfigs[2]);
307306
assertObjectEquals({
308307
providerId: 'yahoo.com',
309-
providerName: 'Yahoo',
308+
// ProviderName should default to providerId if not provided.
309+
providerName: 'yahoo.com',
310310
buttonColor: '#FFB6C1',
311311
iconUrl: '<url-of-the-icon-of-the-sign-in-button>',
312312
loginHintKey: null

0 commit comments

Comments
 (0)