Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
shull4 authored Jun 15, 2018
1 parent 8675f35 commit b6c2808
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
16 changes: 16 additions & 0 deletions firebase.json
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"
}
]
}
}
55 changes: 55 additions & 0 deletions index.html
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>
32 changes: 32 additions & 0 deletions login.js
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");

})

}

0 comments on commit b6c2808

Please sign in to comment.