Skip to content

Commit

Permalink
chore: Shut down accountchooser credential helper (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
xil222 authored Aug 18, 2021
1 parent e286bd0 commit 51c8f7a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 64 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Remove `accountchooser.com` credential helper as well as all its related configs and enums.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1933,11 +1933,18 @@ on a server deployed locally, accessing the application through a `localhost`
address. However, it doesn't impact applications deployed on a server (as you
can verify in the [demo app](https://fir-ui-demo-84a6c.firebaseapp.com/)).

## Deprecated APIs
## Release Notes

**Latest**: https://github.com/firebase/firebaseui-web/releases/latest

**For v1.0.0 and superior:** https://github.com/firebase/firebaseui-web/releases

### 5.0.0

As a result of `accountchooser.com` switching to "universal opt-out" mode on
July 31st, 2020, FirebaseUI will no longer support `accountchooser.com`
credential helper.
`accountchooser.com` has been operating in "universal opt-out" mode and was
shutdown on July 2021. FirebaseUI-web has stopped supporting this credential
helper and since version v5.0.0, all related configurations and enums have been
removed.

- If you are using `firebaseui.auth.CredentialHelper.ACCOUNT_CHOOSER_COM`,
you need to switch to `firebaseui.auth.CredentialHelper.NONE` or
Expand All @@ -1949,12 +1956,6 @@ credential helper.
be provided by the latest
[one-tap API](https://developers.google.com/identity/one-tap/web/reference/js-reference).

## Release Notes

**Latest**: https://github.com/firebase/firebaseui-web/releases/latest

**For v1.0.0 and superior:** https://github.com/firebase/firebaseui-web/releases

### 0.5.0

See the milestone [0.5.0](https://github.com/firebase/firebaseui-web/milestone/1)
Expand Down
14 changes: 1 addition & 13 deletions externs/firebaseui-externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,10 @@ firebaseui.auth.AuthUIError.prototype.toJSON = function() {};


/**
* The FirebaseUI credential helpers available. `ACCOUNT_CHOOSER_COM` is
* deprecated and will be removed by Jan 31st, 2021.
* The FirebaseUI credential helpers available.
* @enum {string}
*/
firebaseui.auth.CredentialHelper = {
ACCOUNT_CHOOSER_COM: 'accountchooser.com',
GOOGLE_YOLO: 'googleyolo',
NONE: 'none'
};
Expand All @@ -485,16 +483,6 @@ firebaseui.auth.CredentialHelper = {
*/
firebaseui.auth.Config = function() {};

/**
* The accountchooser.com configuration when it is selected as credential
* helper. This is now a no-op and is deprecated and will be removed by
* Jan 31st, 2021.
*
* @deprecated
* @type {!Object|undefined}
*/
firebaseui.auth.Config.prototype.acUiConfig;

/**
* Whether to upgrade anonymous users on sign-in. The default is false.
*
Expand Down
12 changes: 3 additions & 9 deletions javascript/utils/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,8 @@ firebaseui.auth.Account = class {
* @return {?firebaseui.auth.Account} The account.
*/
static fromPlainObject(account) {
// TODO: Remove this filter once accountchooser.com supports non-email
// accounts. We will also have to figure out how to choose a sign-in method,
// since fetchProvidersForEmail won't work.
if (account['email']) {
return new firebaseui.auth.Account(
account['email'], account['displayName'], account['photoUrl'],
account['providerId']);
}
return null;
return new firebaseui.auth.Account(
account['email'], account['displayName'], account['photoUrl'],
account['providerId']);
}
};
8 changes: 3 additions & 5 deletions javascript/widgets/authui.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,7 @@ firebaseui.auth.AuthUI.prototype.initElement_ = function(element) {
// Make sure the locale uses hyphens instead of underscores.
container.setAttribute('lang', firebaseui.auth.util.getUnicodeLocale());

// Only one auth instance can be rendered per page. This is because
// accountchooser.com callbacks are set once to the AuthUI instance that
// first calls them.
// Only one auth instance can be rendered per page.
if (firebaseui.auth.AuthUI.widgetAuthUi_) {
// Already rendered, automatically reset.
// First check if there is a pending operation on that widget, if so,
Expand Down Expand Up @@ -612,7 +610,7 @@ firebaseui.auth.AuthUI.prototype.initElement_ = function(element) {
this.currentComponent_.getPageId() == 'blank' &&
this.getConfig().federatedProviderShouldImmediatelyRedirect();
// Removes pending status of previous redirect operations including redirect
// back from accountchooser.com and federated sign in.
// back from federated sign in.
// Remove status after dispatchOperation completes as that operation depends
// on this information.
if (firebaseui.auth.storage.hasRedirectStatus(this.getAppId()) &&
Expand Down Expand Up @@ -809,7 +807,7 @@ firebaseui.auth.AuthUI.prototype.reset = function() {
// Clear email link sign-in state from URL if needed.
this.clearEmailSignInState();
// Removes pending status of previous redirect operations including redirect
// back from accountchooser.com and federated sign in.
// back from federated sign in.
firebaseui.auth.storage.removeRedirectStatus(this.getAppId());
// Cancel One-Tap last operation.
this.cancelOneTapSignIn();
Expand Down
7 changes: 0 additions & 7 deletions javascript/widgets/authui_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,6 @@ function setUp() {
firebaseui.auth.widget.dispatcher,
'dispatchOperation',
goog.testing.recordFunction());
// Simulate accountchooser.com loaded.
testStubs.set(
firebaseui.auth.widget.handler.common,
'loadAccountchooserJs',
function(app, callback, opt_forceUiShownCallback) {
callback();
});
// Install fake test utilities.
testUtil = new firebaseui.auth.testing.FakeUtil().install();
ignoreArgument = goog.testing.mockmatchers.ignoreArgument;
Expand Down
10 changes: 0 additions & 10 deletions javascript/widgets/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ class Config {
constructor() {
/** @const @private {!AuthConfig} The AuthUI config object. */
this.config_ = new AuthConfig();
// Define FirebaseUI widget configurations and convenient getters.
// TODO: This is deprecated and should be removed by Jan 31st, 2021.
this.config_.define('acUiConfig');
this.config_.define('autoUpgradeAnonymousUsers');
this.config_.define('callbacks');
/**
Expand Down Expand Up @@ -857,11 +854,6 @@ class Config {
}
const credentialHelper = this.config_.get('credentialHelper');

// Manually set deprecated accountchooser.com to none.
if (credentialHelper === Config.CredentialHelper.ACCOUNT_CHOOSER_COM) {
return Config.CredentialHelper.NONE;
}

// Make sure the credential helper is valid.
for (let key in Config.CredentialHelper) {
if (Config.CredentialHelper[key] === credentialHelper) {
Expand Down Expand Up @@ -916,8 +908,6 @@ class Config {
* @enum {string}
*/
Config.CredentialHelper = {
// TODO: accountchooser.com is no longer supported. Remove by Jan 31st, 2021.
ACCOUNT_CHOOSER_COM: 'accountchooser.com',
GOOGLE_YOLO: 'googleyolo',
NONE: 'none',
};
Expand Down
3 changes: 0 additions & 3 deletions javascript/widgets/exports_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ goog.exportSymbol('firebaseui.auth.AuthUIError', firebaseui.auth.AuthUIError);
goog.exportSymbol(
'firebaseui.auth.AuthUIError.prototype.toJSON',
firebaseui.auth.AuthUIError.prototype.toJSON);
goog.exportSymbol(
'firebaseui.auth.CredentialHelper.ACCOUNT_CHOOSER_COM',
firebaseui.auth.widget.Config.CredentialHelper.ACCOUNT_CHOOSER_COM);
goog.exportSymbol(
'firebaseui.auth.CredentialHelper.GOOGLE_YOLO',
firebaseui.auth.widget.Config.CredentialHelper.GOOGLE_YOLO);
Expand Down
2 changes: 1 addition & 1 deletion javascript/widgets/handler/providersignin_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function setupProviderSignInPage(
'signInFlow': flow,
'credentialHelper': !!enableOneTap ?
firebaseui.auth.widget.Config.CredentialHelper.GOOGLE_YOLO :
firebaseui.auth.widget.Config.CredentialHelper.ACCOUNT_CHOOSER_COM
firebaseui.auth.widget.Config.CredentialHelper.NONE
});
}
// Set sign-in options.
Expand Down
6 changes: 0 additions & 6 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ interface PhoneSignInOption extends SignInOption {

declare namespace firebaseui.auth {
interface Config {
// This is now a no-op and is deprecated and will be removed by Jan 31st,
// 2021.
acUiConfig?: object;
autoUpgradeAnonymousUsers?: boolean;
callbacks?: Callbacks;
credentialHelper?: CredentialHelperType;
Expand Down Expand Up @@ -166,9 +163,6 @@ declare namespace firebaseui.auth {

class CredentialHelper {
private constructor();
// `ACCOUNT_CHOOSER_COM` is deprecated and will be removed by Jan 31st,
// 2021.
static ACCOUNT_CHOOSER_COM: CredentialHelperType;
static GOOGLE_YOLO: CredentialHelperType;
static NONE: CredentialHelperType;
}
Expand Down

0 comments on commit 51c8f7a

Please sign in to comment.