Skip to content

Commit 5ed86b5

Browse files
author
Thomas Cesare-Herriau
committed
Merge local repository with external GitHub contributions.
2 parents 78e53eb + 7a2f4a5 commit 5ed86b5

File tree

3 files changed

+64
-19
lines changed

3 files changed

+64
-19
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ You just need to include the following script and CSS file in the `<head>` tag o
3636
below the initialization snippet from the Firebase Console:
3737

3838
```html
39-
<script src="https://www.gstatic.com/firebasejs/ui/live/0.5/firebase-ui-auth.js"></script>
40-
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/live/0.5/firebase-ui-auth.css" />
39+
<script src="https://www.gstatic.com/firebasejs/ui/live/1.0/firebase-ui-auth.js"></script>
40+
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/live/1.0/firebase-ui-auth.css" />
4141
```
4242

4343
You can then serve your app locally using `firebase serve`.
@@ -75,7 +75,7 @@ instance should be passed to the constructor of `firebaseui.auth.AuthUI`. You ca
7575
object.
7676

7777
The following example shows how to set up a sign-in screen with all supported providers. Please
78-
refer to the [demo application in the examples folder](examples/demo/) for a more in-depth
78+
refer to the [demo application in the examples folder](demo/) for a more in-depth
7979
example, showcasing a Single Page Application mode.
8080

8181
> Firebase and FirebaseUI do not work when executed directly from a file (i.e. opening the file in
@@ -92,8 +92,8 @@ example, showcasing a Single Page Application mode.
9292
* TODO(DEVELOPER): Paste the initialization snippet from:
9393
* Firebase Console > Overview > Add Firebase to your web app. *
9494
***************************************************************************************** -->
95-
<script src="https://www.gstatic.com/firebasejs/ui/live/0.5/firebase-ui-auth.js"></script>
96-
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/live/0.5/firebase-ui-auth.css" />
95+
<script src="https://www.gstatic.com/firebasejs/ui/live/1.0/firebase-ui-auth.js"></script>
96+
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/live/1.0/firebase-ui-auth.css" />
9797
<script type="text/javascript">
9898
// FirebaseUI config.
9999
var uiConfig = {
@@ -303,8 +303,8 @@ If the callback returns `false` or nothing, the page is not automatically redire
303303
* TODO(DEVELOPER): Paste the initialization snippet from:
304304
* Firebase Console > Overview > Add Firebase to your web app. *
305305
***************************************************************************************** -->
306-
<script src="https://www.gstatic.com/firebasejs/ui/live/0.5/firebase-ui-auth.js"></script>
307-
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/live/0.5/firebase-ui-auth.css" />
306+
<script src="https://www.gstatic.com/firebasejs/ui/live/1.0/firebase-ui-auth.js"></script>
307+
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/live/1.0/firebase-ui-auth.css" />
308308
<script type="text/javascript">
309309
// FirebaseUI config.
310310
var uiConfig = {
@@ -439,7 +439,8 @@ npm run demo
439439
```
440440

441441
This will start a local server serving a FirebaseUI demo app with all local
442-
changes.
442+
changes. More details can be found in the [demo app folder](demo/), covering
443+
how to configure the app to be deployed on a Firebase Hosting instance.
443444

444445
### Running unit tests.
445446

@@ -478,8 +479,18 @@ avoid re-rendering the widget in the middle of an action, but if you do, to avoi
478479
should use the `reset()` method before re-rendering the widget.
479480

480481
## Release Notes
482+
481483
### 1.0.0
482484

485+
See the milestone [1.0.0](https://github.com/firebase/firebaseui-web/milestone/2) for the issues
486+
covered in this release. Below is a summary of the most important ones:
487+
488+
- **FirebaseUI is now open source!** To contribute, please first create an issue describing either
489+
the bug observed or the feature requested. This way we can discuss the relevance of the feature,
490+
before you start working on it. It is also usually better to express the bug before working on a
491+
fix.
492+
- Added an option to disable Account Chooser. See: [Credential Helper](credential-helper).
493+
483494
### 0.5.0
484495

485496
See the milestone [0.5.0](https://github.com/firebase/firebaseui-web/milestone/1) for the issues
@@ -490,7 +501,7 @@ dispose of the widget. When the user leaves a page where the FirebaseUI widget w
490501
instance in the `componentWillUnmount` method of a React component), call the `reset` method of the
491502
`firebaseui.auth.AuthUI` instance you created. Also, call the `reset` method before rendering
492503
again the widget if one has already been rendered on the page. Please refer to the
493-
[demo app](examples/demo/) for guidance on how to use FirebaseUI in a Single Page
504+
[demo app](demo/) for guidance on how to use FirebaseUI in a Single Page
494505
Application context.
495506
- **Custom scopes** can now be added for each provider. See [Custom Scopes](custom-scopes).
496507
- Several issues, different but related to the `displayName` not being present after sign up with

demo/README.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,27 @@ Auth > Sign-in methods.
1818

1919
Run:
2020

21-
git clone https://github.com/firebase/firebaseui-web.git
22-
cd firebaseui-web/examples/demo
23-
firebase use --add
21+
```bash
22+
git clone https://github.com/firebase/firebaseui-web.git
23+
cd firebaseui-web/demo
24+
```
25+
26+
This will clone the repository in the current directory.
2427

25-
This will clone the repository in the current directory, and start a wizard to configure firebase
26-
for your app. Select the project you have created in the prerequisite, and type in `default` or
28+
If you want to be able to deploy the demo app to one of your own Firebase Hosting instance,
29+
configure it using the following command:
30+
31+
```bash
32+
firebase use --add
33+
```
34+
35+
Select the project you have created in the prerequisite, and type in `default` or
2736
any other name as the alias to use for this project.
2837

29-
Copy `demo/public/sample-config.js` to `demo/public/config.js`:
38+
Copy `public/sample-config.js` to `public/config.js`:
3039

3140
```bash
32-
cp demo/public/sample-config.js demo/public/config.js
41+
cp public/sample-config.js public/config.js
3342
```
3443

3544
Then copy and paste the Web snippet code found in the console (either by clicking "Add Firebase to
@@ -38,5 +47,12 @@ in the `config.js` file.
3847

3948
## Deploy
4049

41-
Run `firebase serve` to run a server locally (default: http://localhost:5000) or `firebase deploy` to
42-
deploy the demo.
50+
To deploy the demo app, run the following command in the root directory of FirebaseUI (use `cd ..`
51+
first if you are still in the `demo/` folder):
52+
53+
```bash
54+
npm run demo
55+
```
56+
57+
This will compile all the files needed to run FirebaseUI, and start a Firebase server locally at
58+
http://localhost:5000.

demo/public/app.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@ firebase.auth().onAuthStateChanged(function(user) {
113113
user ? handleSignedInUser(user) : handleSignedOutUser();
114114
});
115115

116+
/**
117+
* Deletes the user's account.
118+
*/
119+
var deleteAccount = function() {
120+
firebase.auth().currentUser.delete().catch(function(error) {
121+
if (error.code == 'auth/requires-recent-login') {
122+
// The user's credential is too old. She needs to sign in again.
123+
firebase.auth().signOut().then(function() {
124+
// The timeout allows the message to be displayed after the UI has
125+
// changed to the signed out state.
126+
setTimeout(function() {
127+
alert('Please sign in again to delete your account.');
128+
}, 1);
129+
});
130+
}
131+
});
132+
};
133+
116134

117135
/**
118136
* Initializes the app.
@@ -127,7 +145,7 @@ var initApp = function() {
127145
});
128146
document.getElementById('delete-account').addEventListener(
129147
'click', function() {
130-
firebase.auth().currentUser.delete();
148+
deleteAccount();
131149
});
132150
};
133151

0 commit comments

Comments
 (0)