File tree Expand file tree Collapse file tree 4 files changed +4
-24
lines changed Expand file tree Collapse file tree 4 files changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -82,19 +82,7 @@ def games():
8282
8383@app .route ('/account' )
8484def account ():
85- # Verify Firebase auth.
86- id_token = request .cookies .get ("token" )
87- error_message = None
88- claims = None
89-
90- if id_token :
91- try :
92- claims = google .oauth2 .id_token .verify_firebase_token (
93- id_token , firebase_request_adapter )
94-
95- except ValueError as exc :
96- error_message = str (exc )
97- return render_template ('account.html' , user_data = claims )
85+ return render_template ('account.html' )
9886
9987if __name__ == '__main__' :
10088 # This is used when running locally only. When deploying to Google App
Original file line number Diff line number Diff line change 11{% extends "base.html" %}
22{% set active_page = "account" %}
33{% block body %}
4- < p > {{ user_data[' name'] }} </ p >
4+ < p id =" account- name" > </ p >
55{% endblock %}
Original file line number Diff line number Diff line change 7979
8080 firebase . auth ( ) . onAuthStateChanged ( function ( user ) {
8181 if ( user ) {
82- console . log ( user . email )
83- console . log ( user . uid )
8482 document . getElementById ( "sign-out" ) . style . display = "block" ;
83+ console . log ( `Signed in as ${ user . displayName } (${ user . email } )` ) ;
84+ document . getElementById ( "account-name" ) . innerHTML = user . displayName
8585 user . getIdToken ( ) . then ( function ( token ) {
8686 // Add the token to the browser's cookies. The server will then be
8787 // able to verify the token against the API.
Original file line number Diff line number Diff line change 3131 < link type ="text/css " rel ="stylesheet " href ="https://www.gstatic.com/firebasejs/ui/4.5.0/firebase-ui-auth.css ">
3232 <!-- [END gae_python3_auth_include_firebaseui] -->
3333 <!-- [END gae_python38_auth_include_firebaseui] -->
34- < script src ="{{ url_for('static', filename='script.js') }} "> </ script >
3534 < link type ="text/css " rel ="stylesheet " href ="{{ url_for('static', filename='index.css') }} ">
3635
3736 </ head >
@@ -89,13 +88,6 @@ <h2>Login info:</h2>
8988 var ui = new firebaseui . auth . AuthUI ( firebase . auth ( ) ) ;
9089
9190 var uiConfig = {
92- callbacks : {
93- signInSuccessWithAuthResult : function ( authResult , redirectUrl ) {
94- // document.getElementById('firebaseui-auth-container').style.display = 'none';
95- // document.getElementById('firebaseui-auth-container').style.display = 'block';
96- return true ;
97- } ,
98- } ,
9991 signInSuccessUrl : '/home' ,
10092 signInOptions : [
10193 firebase . auth . EmailAuthProvider . PROVIDER_ID ,
You can’t perform that action at this time.
0 commit comments