Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the auth domain to carbon-lang.dev. #26

Merged
merged 3 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/firebase/public/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@
<title>Carbon: Login</title>
<script src="/__/firebase/7.14.0/firebase-app.js"></script>
<script src="/__/firebase/7.14.0/firebase-auth.js"></script>
<script src="/__/firebase/init.js"></script>
<script type="text/javascript">
// See https://carbon-lang.dev/__/firebase/init.js.
// We customize authDomain.
firebase.initializeApp({
"apiKey": "AIzaSyDyAAcQeReDNXVUd_ZdkSzYgqIDJe-kPK8",
"authDomain": "carbon-lang.dev",
"databaseURL": "https://carbon-language.firebaseio.com",
"messagingSenderId": "985662022432",
"projectId": "carbon-language",
"storageBucket": "carbon-language.appspot.com"
});

function login() {
var provider = new firebase.auth.GithubAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result) {
Expand All @@ -23,11 +33,6 @@
});
};

firebase.auth().onAuthStateChanged(function(user) {
// If there's no user, we can redirect.
if (!user) redirect();
});

window.onload = function() {
document.cookie = "__session=; expires=Thu, 01 Jan 1970 00:00:00 GMT";
firebase.auth().signOut();
Expand Down
12 changes: 11 additions & 1 deletion src/firebase/public/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@
<title>Carbon: Access denied -- logging out</title>
<script src="/__/firebase/7.14.0/firebase-app.js"></script>
<script src="/__/firebase/7.14.0/firebase-auth.js"></script>
<script src="/__/firebase/init.js"></script>
<script type="text/javascript">
// See https://carbon-lang.dev/__/firebase/init.js.
// We customize authDomain.
firebase.initializeApp({
"apiKey": "AIzaSyDyAAcQeReDNXVUd_ZdkSzYgqIDJe-kPK8",
"authDomain": "carbon-lang.dev",
"databaseURL": "https://carbon-language.firebaseio.com",
"messagingSenderId": "985662022432",
"projectId": "carbon-language",
"storageBucket": "carbon-language.appspot.com"
});

function redirect() {
// Re-clear the cookie, just in case.
document.cookie = "__session=; expires=Thu, 01 Jan 1970 00:00:00 GMT";
Expand Down