chore(auth): rm auth-commpat/demo and auth/cordova/demo (#10118)

This commit is contained in:
Christina Holland
2026-06-29 12:45:27 -07:00
committed by GitHub
parent 74eb167774
commit 104b1e50db
29 changed files with 0 additions and 13018 deletions
-29
View File
@@ -1,29 +0,0 @@
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module.exports = {
extends: '../../../config/.eslintrc.js',
parserOptions: {
project: 'tsconfig.json',
// to make vscode-eslint work with monorepo
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
tsconfigRootDir: __dirname
},
rules: {
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true }]
}
};
-5
View File
@@ -1,5 +0,0 @@
src/config.js
.firebaserc
public/config.js
public/service-worker.*
public/web-worker.*
-73
View File
@@ -1,73 +0,0 @@
# Firebase-Auth for web - Auth Demo (Auth Compatibility Layer)
## Prerequisite
You need to have created a Firebase Project in the
[Firebase Console](https://firebase.google.com/console/) as well as configured a web app.
## Installation
Make sure you run `yarn` to install all dependencies in the root directory.
Enable the Auth providers you would like to offer your users in the console, under
Auth > Sign-in methods.
Run:
```bash
git clone https://github.com/firebase/firebase-js-sdk.git
cd firebase-js-sdk/packages/auth-compat/demo
```
This will clone the repository in the current directory.
If you want to be able to deploy the demo app to one of your own Firebase Hosting instance,
configure it using the following command:
```bash
firebase use --add
```
Select the project you have created in the prerequisite, and type in `default` or
any other name as the alias to use for this project.
Copy `public/sample-config.js` to `public/config.js`:
```bash
cp public/sample-config.js public/config.js
```
Then copy and paste the Web snippet config found in the console (either by clicking "Add Firebase to
your web app" button in your Project overview, or clicking the "Web setup" button in the Auth page)
in the `config.js` file.
In the `functions` folder you'll need to install the admin SDK:
```bash
cd functions
yarn install
```
## Deploy
Before deploying, you may need to build the auth package:
```bash
yarn build:deps
```
You'll also need to build a fully resolved firebase-app.js and firebase-auth.js from auth-compat:
```bash
yarn build
```
This can take some time, and you only need to do it if you've modified the auth or auth-compta packages.
To run the app locally, simply issue the following command in the `auth-compat/demo` directory:
```bash
yarn run demo
```
This will compile all the files needed to run Firebase Auth, and start a Firebase server locally at
[http://localhost:5000](http://localhost:5000).
@@ -1,13 +0,0 @@
{
"rules": {
".read": "auth != null",
".write": "auth != null",
"users": {
"$user_id": {
".read": "$user_id === auth.uid",
".write": "$user_id === auth.uid"
}
}
}
}
-14
View File
@@ -1,14 +0,0 @@
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "/checkIfAuthenticated",
"function": "checkIfAuthenticated"
}
]
}
}
@@ -1,45 +0,0 @@
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Defines the HTTP endpoints hosted via firebase functions which
* are used to test service worker functionality for Firebase Auth via demo
* app.
*/
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.checkIfAuthenticated = functions.https.onRequest((req, res) => {
const idToken = req.get('x-id-token');
res.setHeader('Content-Type', 'application/json');
if (idToken) {
admin
.auth()
.verifyIdToken(idToken)
.then(decodedIdToken => {
res.status(200).send(JSON.stringify({ uid: decodedIdToken.sub }));
})
.catch(error => {
res.status(400).send(JSON.stringify({ error: error.code }));
});
} else {
res.status(403).send(JSON.stringify({ error: 'Unauthorized access' }));
}
});
@@ -1,16 +0,0 @@
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase experimental:functions:shell",
"start": "yarn shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "11.11.1",
"firebase-functions": "3.24.1"
},
"private": true
}
File diff suppressed because it is too large Load Diff
-54
View File
@@ -1,54 +0,0 @@
{
"name": "@firebase/auth-compat-demo",
"version": "0.1.0",
"private": true,
"description": "Demo for Auth SDK Compatibility Layer",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"browser": "public/index.js",
"scripts": {
"lint": "eslint --cache --cache-location '../../../node_modules/.cache/eslint/' -c .eslintrc.js '**/*.ts' --ignore-path '../../../.gitignore'",
"lint:fix": "eslint --cache --cache-location '../../../node_modules/.cache/eslint/' --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../../.gitignore'",
"demo": "rollup -c && firebase serve",
"build": "rollup -c",
"build:deps": "lerna run --scope @firebase/'{app-compat,app,auth-compat}' --include-dependencies build",
"dev": "rollup -c -w"
},
"peerDependencies": {
"@firebase/app-compat": "0.x",
"@firebase/auth-types": "0.x",
"@firebase/auth": "0.x"
},
"dependencies": {
"@firebase/logger": "^0.3.0",
"@firebase/util": "^1.0.0",
"lerna": "^4.0.0",
"tslib": "2.4.0"
},
"license": "Apache-2.0",
"devDependencies": {
"@rollup/plugin-commonjs": "21.1.0",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "16.0.0",
"rollup": "2.80.0",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-typescript2": "0.31.2",
"rollup-plugin-uglify": "6.0.4",
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/auth-compat/demo",
"type": "git",
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
},
"bugs": {
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"typings": "dist/index.d.ts",
"nyc": {
"extension": [
".ts"
],
"reportDir": "./coverage/node"
}
}
-109
View File
@@ -1,109 +0,0 @@
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Utilities for Auth test app features.
*/
/**
* Initializes the widget for toggling reCAPTCHA size.
* @param {function(string):void} callback The callback to call when the
* size toggler is changed, which takes in the new reCAPTCHA size.
*/
function initRecaptchaToggle(callback) {
// Listen to recaptcha config togglers.
var $recaptchaConfigTogglers = $('.toggleRecaptcha');
$recaptchaConfigTogglers.click(function (e) {
// Remove currently active option.
$recaptchaConfigTogglers.removeClass('active');
// Set currently selected option.
$(this).addClass('active');
// Get the current reCAPTCHA setting label.
var size = $(e.target).text().toLowerCase();
callback(size);
});
}
// Install servicerWorker if supported.
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('/service-worker.js', { scope: '/' })
.then(function (reg) {
// Registration worked.
console.log('Registration succeeded. Scope is ' + reg.scope);
})
.catch(function (error) {
// Registration failed.
console.log('Registration failed with ' + error.message);
});
}
var webWorker = null;
if (window.Worker) {
webWorker = new Worker('/web-worker.js');
/**
* Handles the incoming message from the web worker.
* @param {!Object} e The message event received.
*/
webWorker.onmessage = function (e) {
console.log('User data passed through web worker: ', e.data);
switch (e.data.type) {
case 'GET_USER_INFO':
alertSuccess(
'User data passed through web worker: ' + JSON.stringify(e.data)
);
break;
case 'RUN_TESTS':
if (e.data.status == 'success') {
alertSuccess('Web worker tests ran successfully!');
} else {
alertError('Error: ' + JSON.stringify(e.data.error));
}
break;
default:
return;
}
};
}
/**
* Asks the web worker, if supported in current browser, to return the user info
* corresponding to the currentUser as seen within the worker.
*/
function onGetCurrentUserDataFromWebWorker() {
if (webWorker) {
webWorker.postMessage({ type: 'GET_USER_INFO' });
} else {
alertError('Error: Web workers are not supported in the current browser!');
}
}
/**
* Runs various Firebase Auth tests in a web worker environment and confirms the
* expected behavior. This is useful for manual testing in different browsers.
* @param {string} googleIdToken The Google ID token to sign in with.
*/
function runWebWorkerTests(googleIdToken) {
if (webWorker) {
webWorker.postMessage({
type: 'RUN_TESTS',
googleIdToken: googleIdToken
});
} else {
alertError('Error: Web workers are not supported in the current browser!');
}
}
-783
View File
@@ -1,783 +0,0 @@
<!DOCTYPE html>
<!--
Copyright 2023 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Headless App</title>
<link rel="manifest" href="manifest.json">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A=="
crossorigin="anonymous"></script>
<script src="config.js"></script>
<script src="common.js"></script>
<script src="/dist/firebase-app.js"></script>
<script src="/dist/firebase-auth.js"></script>
<script src="/dist/firebase-database.js"></script>
<script src="script.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw=="
crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"
rel="stylesheet"
integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="recaptcha-container"></div>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#menu">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">
Firebase Auth Test App
</a>
</div>
<div class="collapse navbar-collapse" id="menu">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
role="button" aria-haspopup="true" aria-expanded="false">
reCAPTCHA Config <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="dropdown-header">reCAPTCHA Mode</li>
<li class="active toggleRecaptcha">
<a href="#">Normal</a>
</li>
<li class="toggleRecaptcha">
<a href="#">Invisible</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- Placeholder to not confuse the user -->
<div class="container-fluid" id="toggle-user-placeholder">
<div class="btn-group btn-group-justified btn-group-sm">
<a href="javascript:void();" class="btn btn-default current-user">
auth.currentUser
</a>
<a href="javascript:void();" class="btn btn-default disabled">
Last User
</a>
</div>
</div>
<!-- Toggle currentUser, lastUser -->
<div class="container-fluid" id="toggle-user">
<div class="btn-group radio-block" id="toggle-user-selection" data-toggle="buttons">
<label class="btn btn-sm btn-default current-user active">
<input type="radio" name="toggle-user-selection" value="currentUser"
autocomplete="off" checked>auth.currentUser
</label>
<label class="btn btn-sm btn-default last-user">
<input type="radio" name="toggle-user-selection" value="lastUser"
autocomplete="off"> Last User
</label>
</div>
</div>
<!-- Signed in user info -->
<div id="user-info" class="profile">
<div class="pull-left">
<img class="profile-image" />
<span class="profile-name profile-data"></span>
<span class="profile-anonymous">[anonymous]</span> /
uid:
<span class="profile-uid profile-data"></span>
</div>
<div class="pull-right">
<span class="profile-providers"></span>
<span class="profile-phone profile-data"></span> /
<span class="profile-email profile-data"></span>
<span class="profile-email-verified" data-toggle="tooltip"
title="Email Verified" data-placement="bottom">
<i class="fa fa-check"></i>
</span>
<span class="profile-email-not-verified" data-toggle="tooltip"
title="Email Not Verified" data-placement="bottom">
<i class="fa fa-times"></i>
</span>
<div class="btn-group" id="enrolled-factors-drop-down">
<button type="button" class="btn btn-default btn-sm dropdown-toggle"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-key" title="User multi-factor enrolled"
data-toggle="tooltip" data-placement="bottom"></i>
<span class="caret"></span>
</button>
<!-- List of enrolled second factors. -->
<div class="dropdown-menu enrolled-second-factors"></div>
</div>
</div>
<div class="clearfix"></div>
</div>
<!-- Overlaying alert box -->
<div id="alert-messages" class="container-fluid overlaying-alert"></div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-6 actions">
<ul id="tab-menu" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#auth-section" aria-controls="auth-section"
data-toggle="tab" role="tab">
Auth methods
</a>
</li>
<li role="presentation">
<a href="#user-section" aria-controls="user-section"
data-toggle="tab" role="tab">
User methods
</a>
</li>
<li role="presentation">
<a href="#popup-redirect-section"
aria-controls="popup-redirect-section"
data-toggle="tab" role="tab">
Popup/Redirect methods
</a>
</li>
<li role="presentation">
<a href="#action-code-settings-section"
aria-controls="action-code-settings-section"
data-toggle="tab" role="tab">
Action Code Settings
</a>
</li>
<li role="presentation" class="visible-xs">
<a href="#logs-section"
aria-controls="logs-section"
data-toggle="tab" role="tab">
Logs
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="auth-section">
<!-- Development mode APIs -->
<div class="group">Development mode APIs</div>
<form class="form form-bordered no-submit">
<div class="btn-group radio-block" id="enable-app-verification-selection"
data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="enable-app-verification" value="Yes"
autocomplete="off" checked> Enable App Verification
</label>
<label class="btn btn-primary">
<input type="radio" name="enable-app-verification" value="No"
autocomplete="off"> Disable App Verification
</label>
</div>
<button class="btn btn-block btn-primary"
id="apply-auth-settings-change">Apply settings change</button>
</form>
<!-- Worker tests -->
<div class="group">Web Worker Testing</div>
<form class="form form-bordered no-submit">
<button class="btn btn-block btn-primary"
id="run-web-worker-tests">
Run Tests
</button>
</form>
<div class="group">Service Worker Testing</div>
<form class="form form-bordered no-submit">
<button class="btn btn-block btn-primary"
id="run-service-worker-tests">
Run Tests
</button>
</form>
<!-- Persistence-->
<div class="group">Auth State Persistence</div>
<form class="form form-bordered no-submit">
<input type="text" id="persistence-type"
class="form-control" list="persistence-type-options"
placeholder="Persistence" />
<button class="btn btn-block btn-primary"
id="set-persistence">
Set Persistence
</button>
</form>
<!-- Language code -->
<div class="group">Language code</div>
<form class="form form-bordered no-submit">
<input type="text" id="language-code"
class="form-control"
placeholder="Language code" />
<button class="btn btn-block btn-primary"
id="set-language-code">
Set Language Code
</button>
<button class="btn btn-block btn-primary"
id="use-device-language">
Use Device Language
</button>
</form>
<!-- Sign up -->
<div class="group">Sign Up</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="signup-email"
class="form-control" placeholder="Email" />
<input type="password" name="password" id="signup-password"
class="form-control" placeholder="Password" />
<button class="btn btn-block btn-primary"
id="sign-up-with-email-and-password">Sign Up</button>
</form>
<!-- Sign In -->
<div class="group">Sign In</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="signin-email"
class="form-control" placeholder="Email" />
<input type="password" name="password" id="signin-password"
class="form-control" placeholder="Password" />
<button class="btn btn-block btn-primary"
id="sign-in-with-email-and-password">
Sign In with Email and Password
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="user-custom-token" class="form-control"
placeholder="Custom Authentication Token" />
<button class="btn btn-block btn-primary sign-in-with-custom-token"
data-expired=false>
Sign In with Custom Token
</button>
</form>
<button class="btn btn-block btn-primary"
id="sign-in-anonymously">
Sign In Anonymously
</button>
<form class="form form-bordered no-submit">
<input type="text" id="signin-generic-idp-provider-id"
class="form-control" list="federated-provider-id-options"
placeholder="Provider ID" />
<input type="text" id="signin-generic-idp-id-token"
class="form-control" placeholder="ID Token" />
<input type="text" id="signin-generic-idp-raw-nonce"
class="form-control" placeholder="Raw Nonce" />
<input type="text" id="signin-generic-idp-access-token"
class="form-control" placeholder="Access Token" />
<button class="btn btn-block btn-primary"
id="sign-in-with-generic-idp-credential">
Sign In with Generic IdP Credential
</button>
</form>
<form class="form form-bordered no-submit">
<input type="tel" id="signin-phone-number"
class="form-control" placeholder="Phone Number" />
<button class="btn btn-block btn-primary" id="signin-verify-phone-number">
Verify Phone Number
</button>
<input type="text" id="signin-phone-verification-id"
class="form-control" placeholder="Phone Verification ID" />
<input type="text" id="signin-phone-verification-code"
class="form-control" placeholder="Phone Verification Code" />
<button class="btn btn-block btn-primary" id="signin-confirm-phone-verification">
Sign in by Confirming Phone Verification
</button>
</form>
<!-- Sign in with email link -->
<div class="group">Sign In with Email Link</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="sign-in-with-email-link-email"
class="form-control" placeholder="Email" />
<button class="btn btn-block btn-primary"
id="send-sign-in-link-to-email">
Send Sign In With Email Link
</button>
<button class="btn btn-block btn-primary"
id="send-sign-in-link-to-email-current-url">
Send Sign In With Email Link Current URL
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" name="emailLink" id="sign-in-with-email-link-link"
class="form-control" placeholder="Link" />
<button class="btn btn-block btn-primary"
id="sign-in-with-email-link">
Sign In With Email Link
</button>
</form>
<!-- Password Reset Process -->
<div class="group">Password Reset</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="password-reset-email"
class="form-control" placeholder="Email" />
<button class="btn btn-block btn-primary"
id="send-password-reset-email">
Send Password Reset Email
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="password-reset-code"
placeholder="Password Reset Code"
class="form-control" />
<input type="password" id="password-reset-password"
placeholder="New Password"
class="form-control" />
<button class="btn btn-block btn-default"
id="verify-password-reset-code">
Verify Password Reset Code
</button>
<button class="btn btn-block btn-primary"
id="confirm-password-reset">
Confirm Password Change
</button>
</form>
<!-- Fetch Sign In Methods -->
<div class="group">Fetch Sign In Methods</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="fetch-sign-in-methods-email"
class="form-control" placeholder="Email" />
<button class="btn btn-block btn-primary"
id="fetch-sign-in-methods-for-email">
Fetch Sign In Methods For Email
</button>
</form>
<!-- Update Current User -->
<div class="group">Update Current User</div>
<form class="form form-bordered no-submit">
<button class="btn btn-block btn-primary"
id="copy-active-user">
Copy Active User to Temp Auth
</button>
</form>
<form class="form form-bordered no-submit">
<button class="btn btn-block btn-primary"
id="copy-last-user">
Copy Last User to Auth
</button>
</form>
</div>
<div class="tab-pane" id="user-section">
<!-- Profile updates -->
<div class="group">Update Profile</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="changed-email"
class="form-control" placeholder="New email" />
<button class="btn btn-block btn-primary" id="change-email">
Change Email
</button>
</form>
<form class="form form-bordered no-submit">
<input type="password" name="password" id="changed-password"
class="form-control" placeholder="New password" />
<button class="btn btn-block btn-primary" id="change-password">
Change Password
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="display-name" placeholder="Name"
class="form-control profile-name profile-data" />
<input type="text" id="photo-url" placeholder="Photo URL"
class="form-control photo-url profile-data" />
<button class="btn btn-block btn-primary" id="update-profile">
Update Profile
</button>
</form>
<!-- Linking/Unlinking -->
<div class="group">Linking/Unlinking</div>
<button class="btn btn-block btn-default" id="get-provider-data">
Get Providers Data
</button>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="link-email"
class="form-control" placeholder="Email" />
<input type="password" name="password" id="link-password"
class="form-control" placeholder="Password" />
<button class="btn btn-block btn-primary"
id="link-with-email-and-password">
Link with Email and Password
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="link-generic-idp-provider-id"
class="form-control" list="federated-provider-id-options"
placeholder="Provider ID" />
<input type="text" id="link-generic-idp-id-token"
class="form-control" placeholder="ID Token" />
<input type="text" id="link-generic-idp-raw-nonce"
class="form-control" placeholder="Raw Nonce" />
<input type="text" id="link-generic-idp-access-token"
class="form-control" placeholder="Access Token" />
<button class="btn btn-block btn-primary"
id="link-with-generic-idp-credential">
Link with Generic IdP Credential
</button>
</form>
<form class="form form-bordered no-submit">
<input type="tel" id="link-reauth-phone-number"
class="form-control" placeholder="Phone Number" />
<button class="btn btn-block btn-primary" id="link-reauth-verify-phone-number">
Verify Phone Number
</button>
<input type="text" id="link-reauth-phone-verification-id"
class="form-control" placeholder="Phone Verification ID" />
<input type="text" id="link-reauth-phone-verification-code"
class="form-control" placeholder="Phone Verification Code" />
<button class="btn btn-block btn-primary" id="update-confirm-phone-verification">
Update Phone Number by Confirming Phone Verification
</button>
<button class="btn btn-block btn-primary" id="link-confirm-phone-verification">
Link by Confirming Phone Verification
</button>
<button class="btn btn-block btn-primary" id="reauth-confirm-phone-verification">
Reauthenticate by Confirming Phone Verification
</button>
</form>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="link-with-email-link-email"
class="form-control" placeholder="Email" />
<button class="btn btn-block btn-primary"
id="send-link-email-link">
Send Email Link To Link Or Reauthenticate User
</button>
<input type="text" name="emailLink" id="link-with-email-link-link"
class="form-control" placeholder="Link" />
<button class="btn btn-block btn-primary"
id="link-with-email-link">Link With Email Link</button>
<button class="btn btn-block btn-primary"
id="reauth-with-email-link">Reauthenticate With Email Link</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="unlinked-provider-id" class="form-control"
placeholder="Provider ID" list="provider-id-options" />
<button class="btn btn-block btn-primary" id="unlink-provider">
Unlink Provider
</button>
</form>
<!-- Enroll MFA-->
<div class="group">Enroll Second Factor</div>
<ul id="mfa-tab-menu" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#mfa-phone-section" aria-controls="mfa-phone-section"
data-toggle="tab" role="tab">
Phone
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="mfa-phone-section">
<form class="form form-bordered no-submit">
<input type="tel" id="enroll-mfa-phone-number"
class="form-control" placeholder="Phone Number" />
<button class="btn btn-block btn-primary" id="enroll-mfa-verify-phone-number">
Verify Phone Number
</button>
<input type="text" id="enroll-mfa-phone-verification-id"
class="form-control" placeholder="Phone Verification ID" />
<input type="text" id="enroll-mfa-phone-verification-code"
class="form-control" placeholder="Phone Verification Code" />
<input type="text" id="enroll-mfa-phone-display-name"
class="form-control" placeholder="Display Name" />
<button class="btn btn-block btn-primary"
id="enroll-mfa-confirm-phone-verification">
Complete Enrollment
</button>
</form>
</div>
</div>
<!-- Other Actions -->
<div class="group">Other Actions</div>
<button class="btn btn-block btn-default"
id="send-email-verification">
Send Email Verification
</button>
<form class="form form-bordered no-submit">
<input type="text" id="email-verification-code"
placeholder="Email Verification Code"
class="form-control" />
<button class="btn btn-block btn-primary"
id="confirm-email-verification">
Confirm Email Verification
</button>
</form>
<button class="btn btn-block btn-default" id="get-token-result">
Get ID Token Result (no refresh)
</button>
<button class="btn btn-block btn-default" id="refresh-token-result">
Refresh ID Token Result
</button>
<button class="btn btn-block btn-default" id="get-token">
Get ID Token (no refresh)
</button>
<button class="btn btn-block btn-default" id="refresh-token">
Refresh ID Token
</button>
<button class="btn btn-block btn-default" id="get-token-worker">
Get ID Token from Web Worker
</button>
<button class="btn btn-block btn-danger" id="sign-out">
Sign Out
</button>
<!-- Other Actions -->
<div class="group">Delete account</div>
<button class="btn btn-block btn-sm btn-danger" id="delete">
Delete Account
</button>
</div>
<div class="tab-pane" id="popup-redirect-section">
<div class="btn-group radio-block btn-group-justified"
id="popup-redirect-action-selection" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="popup-redirect-action" value="sign-in"
autocomplete="off" checked> Sign in
</label>
<label class="btn btn-primary">
<input type="radio" name="popup-redirect-action" value="link"
autocomplete="off"> Link
</label>
<label class="btn btn-primary">
<input type="radio" name="popup-redirect-action" value="reauthenticate"
autocomplete="off"> Reauthenticate
</label>
</div>
<div class="btn-group radio-block" id="popup-redirect-type-selection"
data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="popup-redirect-type" value="redirect"
autocomplete="off" checked> With Redirect
</label>
<label class="btn btn-primary">
<input type="radio" name="popup-redirect-type" value="popup"
autocomplete="off"> With Popup
</label>
</div>
<div class="form-group">
<label for="scopes">Scopes (separated by commas)</label>
<input type="email" class="form-control" id="scopes" placeholder="scope1,scope2...)">
</div>
<!-- OAuth Custom Parameters Block-->
<div class="form-group">
<label for="scopes">OAuth Custom Parameters</label>
<!-- Container of key/value custom parameter pairs -->
<div id="popup-redirect-custom-parameters"></div>
<!-- Button to add a new key/value pair -->
<button class="btn btn-block btn-primary"
id="popup-redirect-add-custom-parameter">
Add OAuth Custom Parameter
</button>
</div>
<!-- End of OAuth Custom Parameters Block-->
<!-- OAuth Providers Block-->
<div class="form-group">
<label for="scopes">OAuth Providers</label>
<button class="btn btn-block btn-primary popup-redirect-provider"
id="popup-redirect-google" data-provider="google.com">
Google
</button>
<button class="btn btn-block btn-primary popup-redirect-provider"
id="popup-redirect-facebook" data-provider="facebook.com">
Facebook
</button>
<button class="btn btn-block btn-primary popup-redirect-provider"
id="popup-redirect-twitter" data-provider="twitter.com">
Twitter
</button>
<button class="btn btn-block btn-primary popup-redirect-provider"
id="popup-redirect-github" data-provider="github.com">
GitHub
</button>
<form class="form form-bordered no-submit">
<input type="text" name="popup-redirect-generic-providerid"
id="popup-redirect-generic-providerid"
list="federated-provider-id-options"
class="form-control" placeholder="Federated Provider ID" />
<button class="btn btn-block btn-primary" id="popup-redirect-generic">
Generic IdP
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" name="popup-redirect-saml-providerid"
id="popup-redirect-saml-providerid"
class="form-control" placeholder="SAML Provider ID" />
<button class="btn btn-block btn-primary" id="popup-redirect-saml">
SAML IdP
</button>
</form>
</div>
<!-- End of OAuth Providers Block-->
<button class="btn btn-block btn-default"
id="popup-redirect-get-redirect-result">
Get Redirect Result
</button>
</div>
<div class="tab-pane" id="action-code-settings-section">
<div class="group">Web</div>
<div class="form-group">
<input type="text" class="form-control" id="continueUrl"
placeholder="Continue URL"/>
</div>
<div class="group">Android</div>
<form class="form form-bordered no-submit">
<div class="form-group">
<input type="text" class="form-control" id="apn"
placeholder="Android Package Name"/>
<div class="btn-group radio-block" id="install-app-selection"
data-toggle="buttons">
<label class="btn btn-primary">
<input type="radio" name="install-app" value="Yes"
autocomplete="off"> Install app
</label>
<label class="btn btn-primary active">
<input type="radio" name="install-app" value="No"
autocomplete="off" checked> Do not install app
</label>
</div>
<input type="text" class="form-control" id="amv"
placeholder="Android Minimum Version"/>
</div>
</form>
<div class="group">iOS</div>
<form class="form form-bordered no-submit">
<div class="form-group">
<input type="text" class="form-control" id="ibi" placeholder="iOS Bundle ID"/>
</div>
</form>
<form class="form form-bordered no-submit">
<div class="btn-group radio-block" id="handle-in-app-selection"
data-toggle="buttons">
<label class="btn btn-primary">
<input type="radio" name="handle-in-app" value="Yes"
autocomplete="off"> Handle code in app
</label>
<label class="btn btn-primary active">
<input type="radio" name="handle-in-app" value="No"
autocomplete="off" checked> Do not handle code in app
</label>
</div>
<button class="btn btn-block btn-primary"
id="action-code-settings-reset">Reset</button>
</form>
</div>
<div class="tab-pane" id="logs-section">
<pre class="well logs"></pre>
<button class="btn btn-xs btn-default pull-right clear-logs">
Clear
</button>
</div>
</div>
</div>
<div class="col-sm-6 hidden-xs">
<pre class="well logs"></pre>
<button class="btn btn-xs btn-default pull-right clear-logs">
Clear
</button>
</div>
</div>
</div>
<!-- The multi-factor sign-in dialog. -->
<div class="modal" id="multiFactorModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Select a second factor to sign in with</h4>
</div>
<div class="modal-body">
<!-- List of 2nd factor options. -->
<div class="list-group enrolled-second-factors"></div>
<!-- For handling sign-in with phone 2nd factor. -->
<form class="form form-bordered no-submit hidden" id="multi-factor-phone">
<div class="form">
<button class="btn btn-block btn-primary" id="send-2fa-phone-code">
Send code
</button>
</div>
<div class="form">
<input type="text" id="multi-factor-sign-in-verification-id"
class="form-control" placeholder="Phone Verification ID" />
<input type="text" id="multi-factor-sign-in-verification-code"
class="form-control" placeholder="Phone Verification code" />
<button class="btn btn-block btn-primary"
id="sign-in-with-phone-multi-factor">
Complete sign In
</button>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- List of provider ID suggestions. -->
<datalist id="provider-id-options">
<option value="google.com"></option>
<option value="facebook.com"></option>
<option value="twitter.com"></option>
<option value="github.com"></option>
<option value="password"></option>
<option value="phone"></option>
</datalist>
<datalist id="federated-provider-id-options">
<option value="google.com"></option>
<option value="facebook.com"></option>
<option value="twitter.com"></option>
<option value="github.com"></option>
</datalist>
<!-- List of persistence type suggestions. -->
<datalist id="persistence-type-options">
<option value="local"></option>
<option value="session"></option>
<option value="none"></option>
</datalist>
</body>
</html>
@@ -1,13 +0,0 @@
{
"name": "Firebase Auth Test App",
"short_name": "FirebaseAuthTest",
"start_url": "/",
"display": "standalone",
"background_color": "#fff",
"lang": "en-US",
"description": "Test app to test all functionality for Firebase Auth.",
"prefer_related_applications": false,
"theme_color": "#fff",
"scope": "/",
"orientation": "portrait-primary"
}
@@ -1,23 +0,0 @@
/*
* @license
* Copyright 2017 Google LLC All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
var config = {
apiKey: 'YOUR_API_KEY',
authDomain: 'your-app.firebaseapp.com',
databaseURL: 'https://your-app.firebaseio.com',
projectId: 'your-app',
storageBucket: 'your-app.appspot.com',
messagingSenderId: 'MESSAGING_SENDER_ID'
};
File diff suppressed because it is too large Load Diff
-207
View File
@@ -1,207 +0,0 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
body {
padding-top: 70px;
}
body.user-info-displayed {
padding-top: 120px;
}
@media (min-width: 768px) {
body {
padding-bottom: 100px;
}
}
@media (max-width: 767px) {
body {
padding-bottom: 15px;
}
}
#tab-menu {
margin-bottom: 15px;
}
#user-info {
display: none;
padding: 10px 15px;
position: fixed;
top: 50px;
width: 100%;
z-index: 1000;
}
#toggle-user-placeholder {
margin-bottom: 15px;
}
#user-info.current-user,
#toggle-user-placeholder .current-user,
#toggle-user label.active.current-user {
background-color: #d6e9c6;
border: 1px solid #dff0d8;
color: #3c763d;
}
#user-info.last-user,
#toggle-user label.active.last-user {
background-color: #d9edf7;
border: 1px solid #bce8f1;
color: #31708f;
}
#recaptcha-container {
border: 5px solid red;
bottom: 0;
position: fixed;
right: 0;
z-index: 1500;
}
#recaptcha-container:empty {
border: none;
}
.logs {
color: #555;
font-family: 'Courier New', Courier;
font-size: 0.9em;
word-wrap: break-word;
}
.logs > .error {
color: #d9534f;
}
/* Margin top for small screens when the logs are below the buttons */
@media (max-width: 767px) {
.logs {
margin-top: 20px;
}
}
.overlaying-alert {
bottom: 15px;
pointer-events: none;
position: fixed;
width: 100%;
word-wrap: break-word;
z-index: 1010;
}
.actions {
margin-bottom: 15px;
}
.group {
border-top: 1px solid #555;
color: #555;
font-size: 0.9em;
font-weight: bold;
letter-spacing: 0.2em;
margin-bottom: 15px;
padding: 2px 0 0 10px;
}
button + .group,
div + .group,
.btn-block + .group,
.form + .group {
margin-top: 30px;
}
.form {
text-align: center;
}
.form-bordered {
border: 1px solid #CCC;
border-radius: 9px;
padding: 5px;
}
button + .form,
input + .form,
.form + .form {
margin: 15px 0;
}
.form + button,
.form-control + .btn-block,
.form-control + .form-control {
margin-top: 5px;
}
/* Bootstrap .hidden adds the !important which invalidates jQuery .show() */
.hidden,
.hide,
.profile,
.overlaying-alert > .alert,
#toggle-user {
display: none;
}
.profile {
line-height: 30px;
}
@media (max-width: 767px) {
.profile {
/* Use a smaller line height for small screens so user information doesn't
take up half the screen. */
line-height: normal;
}
}
.profile-uid {
font-family: 'Courier New', Courier;
}
.profile-image {
float: left;
height: 30px;
margin-right: 10px;
}
.profile-email-not-verified {
color: #d9534f;
}
.profile-providers {
color: #333;
}
.profile-providers > i {
margin: 0 5px;
}
.radio-block {
margin-bottom: 15px;
width: 100%;
}
.radio-block > label {
width: 50%;
}
/** Overrides default drop down menu styles for enrolled factors display. */
.enrolled-second-factors {
left: initial;
min-width: 400px;
right: 0px;
width: 100%;
}
@@ -1,87 +0,0 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import json from '@rollup/plugin-json';
import resolveModule from '@rollup/plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
import typescriptPlugin from 'rollup-plugin-typescript2';
import typescript from 'typescript';
const plugins = [
sourcemaps(),
resolveModule(),
typescriptPlugin({
typescript,
include: ['../**/*.ts']
}),
json()
];
/**
* Individual Component Builds
*/
const umdBuilds = [
/**
* App UMD Builds
*/
{
input: '../../firebase/compat/app/index.ts',
output: {
file: 'public/dist/firebase-app.js',
sourcemap: true,
format: 'umd',
name: 'firebase'
},
plugins: [...plugins]
},
{
input: `../index.ts`,
output: {
file: `public/dist/firebase-auth.js`,
format: 'umd',
sourcemap: true,
extend: true,
name: 'firebase',
globals: {
'@firebase/app-compat': 'firebase',
'@firebase/app': 'firebase.INTERNAL.modularAPIs'
},
/**
* use iife to avoid below error in the old Safari browser
* SyntaxError: Functions cannot be declared in a nested block in strict mode
* https://github.com/firebase/firebase-js-sdk/issues/1228
*
*/
intro: `
try {
(function() {`,
outro: `
}).apply(this, arguments);
} catch(err) {
console.error(err);
throw new Error(
'Cannot instantiate firebase-auth.js - ' +
'be sure to load firebase-app.js first.'
);
}`
},
plugins: [...plugins],
external: ['@firebase/app-compat', '@firebase/app']
}
];
export default [...umdBuilds];
-13
View File
@@ -1,13 +0,0 @@
{
"extends": "../../../config/tsconfig.base.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"../../../packages/firebase/app",
"../**/*",
],
"exclude": [
"dist/**/*"
]
}
File diff suppressed because it is too large Load Diff
-5
View File
@@ -1,5 +0,0 @@
platforms/
plugins/
ul_web_hooks/
src/config.js
config.xml
-119
View File
@@ -1,119 +0,0 @@
# Cordova Auth Demo App
This package contains a demo of the various Firebase Auth features bundled in
an Apache Cordova app.
## Dev Setup
Follow [this guide](https://cordova.apache.org/docs/en/10.x/guide/cli/) to run
set up Cordova CLI. tl;dr:
```bash
npm install -g cordova
cordova requirements
```
### Preparing the deps
At this point you should have a basic environment set up that can support
Cordova. Now you'll need to update some config files to make everything work.
First, read through steps 1 - 5, 7 in the
[Firebase Auth Cordova docs page](https://firebase.google.com/docs/auth/web/cordova)
so that you get a sense of the values you need to add / adjust.
Make a copy of `sample-config.xml` to `config.xml`, and replace the values
outlined in curly braces. Notably, you'll need the package name / bundle ID
of a registered app in the Firebase Console. You'll also need the Auth Domain
that comes from the Web config.
Next, you'll need to make a copy of `src/sample-config.js` to `src/config.js`,
and you'll need to supply a Firebase JS SDK configuration in the form of that
file.
Once all this is done, you can get the Cordova setup ready in this specific
project:
```bash
cordova prepare
```
Work through any issues until no more errors are printed.
## Building and running the demo
The app consists of a bundled script, `www/dist/bundle.js`. This script is built
from the `./src` directory. To change it, modify the source code in
`src` and then rebuild the bundle:
```bash
# Build the deps the first time, and subsequent times if changing the core SDK
npm run build:deps
npm run build:js
```
### Android
You can now build and test the app on Android Emulator:
```bash
cordova build android
cordova emulate android
# Or
cordova run android
```
TODO: Any tips or gotchas?
### iOS
```bash
cordova build ios
cordova emulate ios
```
Please ignore the command-line output mentioning `logPath` -- that file
[will not actually exist](https://github.com/ios-control/ios-sim/issues/167) and
won't contain JavaScript console logs. The Simulator app itself does not
expose console logs either (System Log won't help).
The recommended way around this is to use the remote debugger in Safari. Launch
the Safari app on the same MacBook, and then go to Safari menu > Preferences >
Advanced and check the "Show Develop menu in menu bar" option. Then, you should
be able to see the Simulator under the Safari `Developer` menu and choose the
app web view (Hello World > Hello World). This only works when the Simulator has
already started and is running the Cordova app. This gives you full access to
console logs AND uncaught errors in the JavaScript code.
WARNING: This may not catch any JavaScript errors during initialization (or
before the debugger was opened). If nothing seems working, try clicking the
Reload Page button in the top-left corner of the inspector, which will reload
the whole web view and hopefully catch the error this time.
#### Xcode
If you really want to, you can also start the Simulator via Xcode. Note that
this will only give you access to console log but WON'T show JavaScript errors
-- for which you still need the Safari remote debugger.
```bash
cordova build ios
open ./platforms/ios/HelloWorld.xcworkspace/
```
Select/add a Simulator through the nav bar and click on "Run" to start it. You
can then find console logs in the corresponding Xcode panel (not in the
Simulator window itself).
If you go this route,
[DO NOT edit files in Xcode IDE](https://cordova.apache.org/docs/en/10.x/guide/platforms/ios/index.html#open-a-project-within-xcode).
Instead, edit files in the `www` folder and run `cordova build ios` to copy the
changes over (and over).
### Notes
You may need to update the cordova-universal-links-plugin `manifestWriter.js`
to point to the correct Android manifest. For example:
```js
var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
```
-52
View File
@@ -1,52 +0,0 @@
{
"name": "cordova-auth-demo",
"displayName": "Cordova Auth Demo",
"version": "1.0.0",
"scripts": {
"build:js": "rollup -c",
"build:deps": "lerna run --scope @firebase/'{app,auth/cordova}' --include-dependencies build"
},
"keywords": [
"ecosystem:cordova"
],
"devDependencies": {
"cordova-android": "9.1.0",
"cordova-ios": "6.2.0",
"cordova-plugin-whitelist": "1.3.5",
"cordova-universal-links-plugin": "1.2.1",
"rollup": "2.79.1"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-buildinfo": {},
"cordova-universal-links-plugin": {},
"cordova-plugin-browsertab": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-customurlscheme": {
"URL_SCHEME": "com.example.hello",
"ANDROID_SCHEME": " ",
"ANDROID_HOST": " ",
"ANDROID_PATHPREFIX": "/"
}
},
"platforms": [
"ios",
"android"
]
},
"dependencies": {
"@firebase/app": "0.7.24",
"@firebase/auth": "0.20.1",
"@firebase/logger": "0.3.2",
"@firebase/util": "1.6.0",
"cordova-plugin-browsertab": "0.2.0",
"cordova-plugin-buildinfo": "4.0.0",
"cordova-plugin-compat": "1.2.0",
"cordova-plugin-customurlscheme": "5.0.2",
"cordova-plugin-inappbrowser": "4.1.0",
"cordova-universal-links-plugin-fix": "^1.2.1",
"lerna": "^4.0.0",
"tslib": "^2.1.0"
}
}
@@ -1,32 +0,0 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import resolve from '@rollup/plugin-node-resolve';
import strip from '@rollup/plugin-strip';
/**
* Browser Build
*/
const esmBuild = {
input: 'src/index.js',
output: [{ file: 'www/dist/bundle.js', format: 'esm', sourcemap: true }],
plugins: [
strip({ functions: ['debugAssert.*'] }),
resolve({ mainFields: ['module', 'main'] })
]
};
export default esmBuild;
@@ -1,33 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
Copyright 2023 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<widget id="{{YOUR PACKAGE NAME / BUNDLE ID HERE}}" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Cordova Auth Demo</name>
<content src="index.html" />
<!-- CAUTION: THESE PERMISSIONS ARE OVERLY BROAD AND SHOULD ONLY BE USED FOR DEMO PURPOSES -->
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<universal-links>
<host name="{{DYNAMIC LINK DOMAIN}}" scheme="https" />
<host name="{{YOUR AUTH DOMAIN HERE}}" scheme="https">
<path url="/__/auth/callback"/>
</host>
</universal-links>
<preference name="AndroidLaunchMode" value="singleTask" />
<preference name="android-minSdkVersion" value="22" />
</widget>
File diff suppressed because it is too large Load Diff
-121
View File
@@ -1,121 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Fix for IE8 when developer's console is not opened.
if (!window.console) {
window.console = {
log() {},
error() {}
};
}
/**
* Logs the message in the console and on the log window in the app
* using the level given.
* @param {?Object} message Object or message to log.
* @param {string} level The level of log (log, error, debug).
* @private
*/
export function logAtLevel_(message, level) {
if (message != null) {
const messageDiv = $('<div></div>');
messageDiv.addClass(level);
if (typeof message === 'object') {
messageDiv.text(JSON.stringify(message, null, ' '));
} else {
messageDiv.text(message);
}
$('.logs').append(messageDiv);
}
console[level](message);
}
/**
* Logs info level.
* @param {string} message Object or message to log.
*/
export function log(message) {
logAtLevel_(message, 'log');
}
/**
* Clear the logs.
*/
export function clearLogs() {
$('.logs').text('');
}
/**
* Displays for a few seconds a box with a specific message and then fades
* it out.
* @param {string} message Small message to display.
* @param {string} cssClass The class(s) to give the alert box.
* @private
*/
function alertMessage_(message, cssClass) {
const alertBox = $('<div></div>')
.addClass(cssClass)
.css('display', 'none')
.text(message);
// When modals are visible, display the alert in the modal layer above the
// grey background.
const visibleModal = $('.modal.in');
if (visibleModal.size() > 0) {
// Check first if the model has an overlaying-alert. If not, append the
// overlaying-alert container.
if (visibleModal.find('.overlaying-alert').size() === 0) {
const $overlayingAlert = $(
'<div class="container-fluid overlaying-alert"></div>'
);
visibleModal.append($overlayingAlert);
}
visibleModal.find('.overlaying-alert').prepend(alertBox);
} else {
$('#alert-messages').prepend(alertBox);
}
alertBox.fadeIn({
complete() {
setTimeout(() => {
alertBox.slideUp(400, () => {
// On completion, remove the alert element from the DOM.
alertBox.remove();
});
}, 3000);
}
});
}
/**
* Alerts a small success message in a overlaying alert box.
* @param {string} message Small message to display.
*/
export function alertSuccess(message) {
alertMessage_(message, 'alert alert-success');
}
/**
* Alerts a small error message in a overlaying alert box.
* @param {string} message Small message to display.
*/
export function alertError(message) {
alertMessage_(message, 'alert alert-danger');
}
export function alertNotImplemented() {
alertError('Method not yet implemented in the new SDK');
}
-23
View File
@@ -1,23 +0,0 @@
/*
* @license
* Copyright 2017 Google LLC All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
export const config = {
apiKey: 'YOUR_API_KEY',
authDomain: 'your-app.firebaseapp.com',
databaseURL: 'https://your-app.firebaseio.com',
projectId: 'your-app',
storageBucket: 'your-app.appspot.com',
messagingSenderId: 'MESSAGING_SENDER_ID'
};
-680
View File
@@ -1,680 +0,0 @@
<!DOCTYPE html>
<!--
Copyright 2023 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Headless App</title>
<link rel="manifest" href="manifest.json">
<script src="cordova.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A=="
crossorigin="anonymous"></script>
<script src="dist/bundle.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw=="
crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"
rel="stylesheet"
integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="recaptcha-container"></div>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#menu">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">
Firebase Auth Test App
</a>
</div>
<div class="collapse navbar-collapse" id="menu">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
role="button" aria-haspopup="true" aria-expanded="false">
reCAPTCHA Config <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="dropdown-header">reCAPTCHA Mode</li>
<li class="active toggleRecaptcha">
<a href="#">Normal</a>
</li>
<li class="toggleRecaptcha">
<a href="#">Invisible</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- Placeholder to not confuse the user -->
<div class="container-fluid" id="toggle-user-placeholder">
<div class="btn-group btn-group-justified btn-group-sm">
<a href="javascript:void();" class="btn btn-default current-user">
auth.currentUser
</a>
<a href="javascript:void();" class="btn btn-default disabled">
Last User
</a>
</div>
</div>
<!-- Toggle currentUser, lastUser -->
<div class="container-fluid" id="toggle-user">
<div class="btn-group radio-block" id="toggle-user-selection" data-toggle="buttons">
<label class="btn btn-sm btn-default current-user active">
<input type="radio" name="toggle-user-selection" value="currentUser"
autocomplete="off" checked>auth.currentUser
</label>
<label class="btn btn-sm btn-default last-user">
<input type="radio" name="toggle-user-selection" value="lastUser"
autocomplete="off"> Last User
</label>
</div>
</div>
<!-- Signed in user info -->
<div id="user-info" class="profile">
<div class="pull-left">
<img class="profile-image" />
<span class="profile-name profile-data"></span>
<span class="profile-anonymous">[anonymous]</span> /
uid:
<span class="profile-uid profile-data"></span>
</div>
<div class="pull-right">
<span class="profile-providers"></span>
<span class="profile-phone profile-data"></span> /
<span class="profile-email profile-data"></span>
<span class="profile-email-verified" data-toggle="tooltip"
title="Email Verified" data-placement="bottom">
<i class="fa fa-check"></i>
</span>
<span class="profile-email-not-verified" data-toggle="tooltip"
title="Email Not Verified" data-placement="bottom">
<i class="fa fa-times"></i>
</span>
<div class="btn-group" id="enrolled-factors-drop-down">
<button type="button" class="btn btn-default btn-sm dropdown-toggle"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-key" title="User multi-factor enrolled"
data-toggle="tooltip" data-placement="bottom"></i>
<span class="caret"></span>
</button>
<!-- List of enrolled second factors. -->
<div class="dropdown-menu enrolled-second-factors"></div>
</div>
</div>
<div class="clearfix"></div>
</div>
<!-- Overlaying alert box -->
<div id="alert-messages" class="container-fluid overlaying-alert"></div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-6 actions">
<ul id="tab-menu" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#auth-section" aria-controls="auth-section"
data-toggle="tab" role="tab">
Auth methods
</a>
</li>
<li role="presentation">
<a href="#user-section" aria-controls="user-section"
data-toggle="tab" role="tab">
User methods
</a>
</li>
<li role="presentation">
<a href="#popup-redirect-section"
aria-controls="popup-redirect-section"
data-toggle="tab" role="tab">
Popup/Redirect methods
</a>
</li>
<li role="presentation">
<a href="#action-code-settings-section"
aria-controls="action-code-settings-section"
data-toggle="tab" role="tab">
Action Code Settings
</a>
</li>
<li role="presentation" class="visible-xs">
<a href="#logs-section"
aria-controls="logs-section"
data-toggle="tab" role="tab">
Logs
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="auth-section">
<!-- Persistence-->
<div class="group">Auth State Persistence</div>
<form class="form form-bordered no-submit">
<input type="text" id="persistence-type"
class="form-control" list="persistence-type-options"
placeholder="Persistence" />
<button class="btn btn-block btn-primary"
id="set-persistence">
Set Persistence
</button>
</form>
<!-- Language code -->
<div class="group">Language code</div>
<form class="form form-bordered no-submit">
<input type="text" id="language-code"
class="form-control"
placeholder="Language code" />
<button class="btn btn-block btn-primary"
id="set-language-code">
Set Language Code
</button>
<button class="btn btn-block btn-primary"
id="use-device-language">
Use Device Language
</button>
</form>
<!-- Sign up -->
<div class="group">Sign Up</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="signup-email"
class="form-control" placeholder="Email" />
<input type="password" name="password" id="signup-password"
class="form-control" placeholder="Password" />
<button class="btn btn-block btn-primary"
id="sign-up-with-email-and-password">Sign Up</button>
</form>
<!-- Sign In -->
<div class="group">Sign In</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="signin-email"
class="form-control" placeholder="Email" />
<input type="password" name="password" id="signin-password"
class="form-control" placeholder="Password" />
<button class="btn btn-block btn-primary"
id="sign-in-with-email-and-password">
Sign In with Email and Password
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="user-custom-token" class="form-control"
placeholder="Custom Authentication Token" />
<button class="btn btn-block btn-primary sign-in-with-custom-token"
data-expired=false>
Sign In with Custom Token
</button>
</form>
<button class="btn btn-block btn-primary"
id="sign-in-anonymously">
Sign In Anonymously
</button>
<form class="form form-bordered no-submit">
<input type="text" id="signin-generic-idp-provider-id"
class="form-control" list="federated-provider-id-options"
placeholder="Provider ID" />
<input type="text" id="signin-generic-idp-id-token"
class="form-control" placeholder="ID Token" />
<input type="text" id="signin-generic-idp-raw-nonce"
class="form-control" placeholder="Raw Nonce" />
<input type="text" id="signin-generic-idp-access-token"
class="form-control" placeholder="Access Token" />
<button class="btn btn-block btn-primary"
id="sign-in-with-generic-idp-credential">
Sign In with Generic IdP Credential
</button>
</form>
<!-- Sign in with email link -->
<div class="group">Sign In with Email Link</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="sign-in-with-email-link-email"
class="form-control" placeholder="Email" />
<button class="btn btn-block btn-primary"
id="send-sign-in-link-to-email">
Send Sign In With Email Link
</button>
<button class="btn btn-block btn-primary"
id="send-sign-in-link-to-email-current-url">
Send Sign In With Email Link Current URL
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" name="emailLink" id="sign-in-with-email-link-link"
class="form-control" placeholder="Link" />
<button class="btn btn-block btn-primary"
id="sign-in-with-email-link">
Sign In With Email Link
</button>
</form>
<!-- Password Reset Process -->
<div class="group">Password Reset</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="password-reset-email"
class="form-control" placeholder="Email" />
<button class="btn btn-block btn-primary"
id="send-password-reset-email">
Send Password Reset Email
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="password-reset-code"
placeholder="Password Reset Code"
class="form-control" />
<input type="password" id="password-reset-password"
placeholder="New Password"
class="form-control" />
<button class="btn btn-block btn-default"
id="verify-password-reset-code">
Verify Password Reset Code
</button>
<button class="btn btn-block btn-primary"
id="confirm-password-reset">
Confirm Password Change
</button>
</form>
<!-- Fetch Sign In Methods -->
<div class="group">Fetch Sign In Methods</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="fetch-sign-in-methods-email"
class="form-control" placeholder="Email" />
<button class="btn btn-block btn-primary"
id="fetch-sign-in-methods-for-email">
Fetch Sign In Methods For Email
</button>
</form>
<!-- Update Current User -->
<div class="group">Update Current User</div>
<form class="form form-bordered no-submit">
<button class="btn btn-block btn-primary"
id="copy-active-user">
Copy Active User to Temp Auth
</button>
</form>
<form class="form form-bordered no-submit">
<button class="btn btn-block btn-primary"
id="copy-last-user">
Copy Last User to Auth
</button>
</form>
</div>
<div class="tab-pane" id="user-section">
<!-- Profile updates -->
<div class="group">Update Profile</div>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="changed-email"
class="form-control" placeholder="New email" />
<button class="btn btn-block btn-primary" id="change-email">
Change Email
</button>
</form>
<form class="form form-bordered no-submit">
<input type="password" name="password" id="changed-password"
class="form-control" placeholder="New password" />
<button class="btn btn-block btn-primary" id="change-password">
Change Password
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="display-name" placeholder="Name"
class="form-control profile-name profile-data" />
<input type="text" id="photo-url" placeholder="Photo URL"
class="form-control photo-url profile-data" />
<button class="btn btn-block btn-primary" id="update-profile">
Update Profile
</button>
</form>
<!-- Linking/Unlinking -->
<div class="group">Linking/Unlinking</div>
<button class="btn btn-block btn-default" id="get-provider-data">
Get Providers Data
</button>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="link-email"
class="form-control" placeholder="Email" />
<input type="password" name="password" id="link-password"
class="form-control" placeholder="Password" />
<button class="btn btn-block btn-primary"
id="link-with-email-and-password">
Link with Email and Password
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="link-generic-idp-provider-id"
class="form-control" list="federated-provider-id-options"
placeholder="Provider ID" />
<input type="text" id="link-generic-idp-id-token"
class="form-control" placeholder="ID Token" />
<input type="text" id="link-generic-idp-raw-nonce"
class="form-control" placeholder="Raw Nonce" />
<input type="text" id="link-generic-idp-access-token"
class="form-control" placeholder="Access Token" />
<button class="btn btn-block btn-primary"
id="link-with-generic-idp-credential">
Link with Generic IdP Credential
</button>
</form>
<form class="form form-bordered no-submit">
<input type="email" name="email" id="link-with-email-link-email"
class="form-control" placeholder="Email" />
<button class="btn btn-block btn-primary"
id="send-link-email-link">
Send Email Link To Link Or Reauthenticate User
</button>
<input type="text" name="emailLink" id="link-with-email-link-link"
class="form-control" placeholder="Link" />
<button class="btn btn-block btn-primary"
id="link-with-email-link">Link With Email Link</button>
<button class="btn btn-block btn-primary"
id="reauth-with-email-link">Reauthenticate With Email Link</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" id="unlinked-provider-id" class="form-control"
placeholder="Provider ID" list="provider-id-options" />
<button class="btn btn-block btn-primary" id="unlink-provider">
Unlink Provider
</button>
</form>
<!-- Enroll MFA-->
<div class="group">Enroll Second Factor</div>
<ul id="mfa-tab-menu" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
</li>
</ul>
<!-- Other Actions -->
<div class="group">Other Actions</div>
<button class="btn btn-block btn-default"
id="send-email-verification">
Send Email Verification
</button>
<form class="form form-bordered no-submit">
<input type="text" id="email-verification-code"
placeholder="Email Verification Code"
class="form-control" />
<button class="btn btn-block btn-primary"
id="confirm-email-verification">
Confirm Email Verification
</button>
</form>
<button class="btn btn-block btn-default" id="get-token-result">
Get ID Token Result (no refresh)
</button>
<button class="btn btn-block btn-default" id="refresh-token-result">
Refresh ID Token Result
</button>
<button class="btn btn-block btn-default" id="get-token">
Get ID Token (no refresh)
</button>
<button class="btn btn-block btn-default" id="refresh-token">
Refresh ID Token
</button>
<button class="btn btn-block btn-default" id="get-token-worker">
Get ID Token from Web Worker
</button>
<button class="btn btn-block btn-danger" id="sign-out">
Sign Out
</button>
<!-- Other Actions -->
<div class="group">Delete account</div>
<button class="btn btn-block btn-sm btn-danger" id="delete">
Delete Account
</button>
</div>
<div class="tab-pane" id="popup-redirect-section">
<div class="btn-group radio-block btn-group-justified"
id="popup-redirect-action-selection" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="popup-redirect-action" value="sign-in"
autocomplete="off" checked> Sign in
</label>
<label class="btn btn-primary">
<input type="radio" name="popup-redirect-action" value="link"
autocomplete="off"> Link
</label>
<label class="btn btn-primary">
<input type="radio" name="popup-redirect-action" value="reauthenticate"
autocomplete="off"> Reauthenticate
</label>
</div>
<div class="btn-group radio-block" id="popup-redirect-type-selection"
data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="popup-redirect-type" value="redirect"
autocomplete="off" checked> With Redirect
</label>
</div>
<div class="form-group">
<label for="scopes">Scopes (separated by commas)</label>
<input type="email" class="form-control" id="scopes" placeholder="scope1,scope2...)">
</div>
<!-- OAuth Custom Parameters Block-->
<div class="form-group">
<label for="scopes">OAuth Custom Parameters</label>
<!-- Container of key/value custom parameter pairs -->
<div id="popup-redirect-custom-parameters"></div>
<!-- Button to add a new key/value pair -->
<button class="btn btn-block btn-primary"
id="popup-redirect-add-custom-parameter">
Add OAuth Custom Parameter
</button>
</div>
<!-- End of OAuth Custom Parameters Block-->
<!-- OAuth Providers Block-->
<div class="form-group">
<label for="scopes">OAuth Providers</label>
<button class="btn btn-block btn-primary popup-redirect-provider"
id="popup-redirect-google" data-provider="google.com">
Google
</button>
<button class="btn btn-block btn-primary popup-redirect-provider"
id="popup-redirect-facebook" data-provider="facebook.com">
Facebook
</button>
<button class="btn btn-block btn-primary popup-redirect-provider"
id="popup-redirect-twitter" data-provider="twitter.com">
Twitter
</button>
<button class="btn btn-block btn-primary popup-redirect-provider"
id="popup-redirect-github" data-provider="github.com">
GitHub
</button>
<form class="form form-bordered no-submit">
<input type="text" name="popup-redirect-generic-providerid"
id="popup-redirect-generic-providerid"
list="federated-provider-id-options"
class="form-control" placeholder="Federated Provider ID" />
<button class="btn btn-block btn-primary" id="popup-redirect-generic">
Generic IdP
</button>
</form>
<form class="form form-bordered no-submit">
<input type="text" name="popup-redirect-saml-providerid"
id="popup-redirect-saml-providerid"
class="form-control" placeholder="SAML Provider ID" />
<button class="btn btn-block btn-primary" id="popup-redirect-saml">
SAML IdP
</button>
</form>
</div>
<!-- End of OAuth Providers Block-->
<button class="btn btn-block btn-default"
id="popup-redirect-get-redirect-result">
Get Redirect Result
</button>
</div>
<div class="tab-pane" id="action-code-settings-section">
<div class="group">Web</div>
<div class="form-group">
<input type="text" class="form-control" id="continueUrl"
placeholder="Continue URL"/>
</div>
<div class="group">Android</div>
<form class="form form-bordered no-submit">
<div class="form-group">
<input type="text" class="form-control" id="apn"
placeholder="Android Package Name"/>
<div class="btn-group radio-block" id="install-app-selection"
data-toggle="buttons">
<label class="btn btn-primary">
<input type="radio" name="install-app" value="Yes"
autocomplete="off"> Install app
</label>
<label class="btn btn-primary active">
<input type="radio" name="install-app" value="No"
autocomplete="off" checked> Do not install app
</label>
</div>
<input type="text" class="form-control" id="amv"
placeholder="Android Minimum Version"/>
</div>
</form>
<div class="group">iOS</div>
<form class="form form-bordered no-submit">
<div class="form-group">
<input type="text" class="form-control" id="ibi" placeholder="iOS Bundle ID"/>
</div>
</form>
<form class="form form-bordered no-submit">
<div class="btn-group radio-block" id="handle-in-app-selection"
data-toggle="buttons">
<label class="btn btn-primary">
<input type="radio" name="handle-in-app" value="Yes"
autocomplete="off"> Handle code in app
</label>
<label class="btn btn-primary active">
<input type="radio" name="handle-in-app" value="No"
autocomplete="off" checked> Do not handle code in app
</label>
</div>
<button class="btn btn-block btn-primary"
id="action-code-settings-reset">Reset</button>
</form>
</div>
<div class="tab-pane" id="logs-section">
<pre class="well logs"></pre>
<button class="btn btn-xs btn-default pull-right clear-logs">
Clear
</button>
</div>
</div>
</div>
<div class="col-sm-6 hidden-xs">
<pre class="well logs"></pre>
<button class="btn btn-xs btn-default pull-right clear-logs">
Clear
</button>
</div>
</div>
</div>
<!-- The multi-factor sign-in dialog. -->
<div class="modal" id="multiFactorModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Select a second factor to sign in with</h4>
</div>
<div class="modal-body">
<!-- List of 2nd factor options. -->
<div class="list-group enrolled-second-factors"></div>
<!-- For handling sign-in with phone 2nd factor. -->
<form class="form form-bordered no-submit hidden" id="multi-factor-phone">
<div class="form">
<button class="btn btn-block btn-primary" id="send-2fa-phone-code">
Send code
</button>
</div>
<div class="form">
<input type="text" id="multi-factor-sign-in-verification-id"
class="form-control" placeholder="Phone Verification ID" />
<input type="text" id="multi-factor-sign-in-verification-code"
class="form-control" placeholder="Phone Verification code" />
<button class="btn btn-block btn-primary"
id="sign-in-with-phone-multi-factor">
Complete sign In
</button>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- List of provider ID suggestions. -->
<datalist id="provider-id-options">
<option value="google.com"></option>
<option value="facebook.com"></option>
<option value="twitter.com"></option>
<option value="github.com"></option>
<option value="password"></option>
<option value="phone"></option>
</datalist>
<datalist id="federated-provider-id-options">
<option value="google.com"></option>
<option value="facebook.com"></option>
<option value="twitter.com"></option>
<option value="github.com"></option>
</datalist>
<!-- List of persistence type suggestions. -->
<datalist id="persistence-type-options">
<option value="local"></option>
<option value="session"></option>
<option value="indexedDB"></option>
<option value="none"></option>
</datalist>
</body>
</html>
-207
View File
@@ -1,207 +0,0 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
body {
padding-top: 70px;
}
body.user-info-displayed {
padding-top: 120px;
}
@media (min-width: 768px) {
body {
padding-bottom: 100px;
}
}
@media (max-width: 767px) {
body {
padding-bottom: 15px;
}
}
#tab-menu {
margin-bottom: 15px;
}
#user-info {
display: none;
padding: 10px 15px;
position: fixed;
top: 50px;
width: 100%;
z-index: 1000;
}
#toggle-user-placeholder {
margin-bottom: 15px;
}
#user-info.current-user,
#toggle-user-placeholder .current-user,
#toggle-user label.active.current-user {
background-color: #d6e9c6;
border: 1px solid #dff0d8;
color: #3c763d;
}
#user-info.last-user,
#toggle-user label.active.last-user {
background-color: #d9edf7;
border: 1px solid #bce8f1;
color: #31708f;
}
#recaptcha-container {
border: 5px solid red;
bottom: 0;
position: fixed;
right: 0;
z-index: 1500;
}
#recaptcha-container:empty {
border: none;
}
.logs {
color: #555;
font-family: 'Courier New', Courier;
font-size: 0.9em;
word-wrap: break-word;
}
.logs > .error {
color: #d9534f;
}
/* Margin top for small screens when the logs are below the buttons */
@media (max-width: 767px) {
.logs {
margin-top: 20px;
}
}
.overlaying-alert {
bottom: 15px;
pointer-events: none;
position: fixed;
width: 100%;
word-wrap: break-word;
z-index: 1010;
}
.actions {
margin-bottom: 15px;
}
.group {
border-top: 1px solid #555;
color: #555;
font-size: 0.9em;
font-weight: bold;
letter-spacing: 0.2em;
margin-bottom: 15px;
padding: 2px 0 0 10px;
}
button + .group,
div + .group,
.btn-block + .group,
.form + .group {
margin-top: 30px;
}
.form {
text-align: center;
}
.form-bordered {
border: 1px solid #CCC;
border-radius: 9px;
padding: 5px;
}
button + .form,
input + .form,
.form + .form {
margin: 15px 0;
}
.form + button,
.form-control + .btn-block,
.form-control + .form-control {
margin-top: 5px;
}
/* Bootstrap .hidden adds the !important which invalidates jQuery .show() */
.hidden,
.hide,
.profile,
.overlaying-alert > .alert,
#toggle-user {
display: none;
}
.profile {
line-height: 30px;
}
@media (max-width: 767px) {
.profile {
/* Use a smaller line height for small screens so user information doesn't
take up half the screen. */
line-height: normal;
}
}
.profile-uid {
font-family: 'Courier New', Courier;
}
.profile-image {
float: left;
height: 30px;
margin-right: 10px;
}
.profile-email-not-verified {
color: #d9534f;
}
.profile-providers {
color: #333;
}
.profile-providers > i {
margin: 0 5px;
}
.radio-block {
margin-bottom: 15px;
width: 100%;
}
.radio-block > label {
width: 50%;
}
/** Overrides default drop down menu styles for enrolled factors display. */
.enrolled-second-factors {
left: initial;
min-width: 400px;
right: 0px;
width: 100%;
}