-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"hosting": { | ||
"public": "public", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
], | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Programming Strategies Login</title> | ||
<style>body {background-color: #c9e2b3}</style> | ||
<!-- ******************************************************************************************* | ||
* TODO(DEVELOPER): Paste the initialization snippet from: | ||
* Firebase Console > Overview > Add Firebase to your web app. * | ||
***************************************************************************************** --> | ||
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase.js"></script> | ||
<script> | ||
// Initialize Firebase | ||
var config = { | ||
apiKey: "AIzaSyAXjL6f739BVqLDknymCN2H36-NBDS8LvY", | ||
authDomain: "strategytracker.firebaseapp.com", | ||
databaseURL: "https://strategytracker.firebaseio.com", | ||
projectId: "strategytracker", | ||
storageBucket: "strategytracker.appspot.com", | ||
messagingSenderId: "261249836518" | ||
}; | ||
firebase.initializeApp(config); | ||
</script> | ||
|
||
<script src="https://cdn.firebase.com/libs/firebaseui/3.0.0/firebaseui.js"></script> | ||
<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/3.0.0/firebaseui.css" /> | ||
<script type="text/javascript"> | ||
// FirebaseUI config. | ||
var uiConfig = { | ||
signInSuccessUrl: 'http://programmingstrategies.org/StrategyTracker/StrategyTracker.html', | ||
signInOptions: [ | ||
// Leave the lines as is for the providers you want to offer your users. | ||
firebase.auth.GoogleAuthProvider.PROVIDER_ID, | ||
|
||
], | ||
// Terms of service url. | ||
tosUrl: '<your-tos-url>' | ||
}; | ||
|
||
// Initialize the FirebaseUI Widget using Firebase. | ||
var ui = new firebaseui.auth.AuthUI(firebase.auth()); | ||
// The start method will wait until the DOM is loaded. | ||
ui.start('#firebaseui-auth-container', uiConfig); | ||
|
||
</script> | ||
|
||
</head> | ||
<body> | ||
<!-- The surrounding HTML is left untouched by FirebaseUI. | ||
Your app may use that space for branding, controls and other customizations.--> | ||
<h1 style="text-align:center">Welcome to Strategy Tracker <br> | ||
Please sign in below</h1> | ||
<div id="firebaseui-auth-container"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
document.addEventListener("DOMContentLoaded", event => { | ||
const app = firebase.app(); | ||
|
||
}); | ||
|
||
firebase.auth.onAuthStateChanged(function(user) { | ||
if(user) | ||
{ | ||
window.alert("Redirecting"); | ||
window.location('/StrategyTracker.html'); | ||
} | ||
else | ||
{ | ||
window.alert("Logout Successful"); | ||
} | ||
}) | ||
|
||
function googleLogin() { | ||
const provider = new firebase.auth.GoogleAuthProvider(); | ||
|
||
firebase.auth().signInWithPopup(provider).catch(function(error) { | ||
|
||
var errorCode = error.code; | ||
var errorMess = error.message; | ||
|
||
window.alert("No access to this account.\n" + | ||
"Please contract Admin"); | ||
|
||
}) | ||
|
||
} | ||
|