File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515def index ():
1616 if not session .get ("user" ):
1717 return redirect (url_for ("login" ))
18- return """Welcome, %s.
19- <li><a href='/graphcall'>Call Microsoft Graph API</a></li>
20- <li><a href="/logout">Logout</a></li>
21- """ % session ["user" ].get ("name" )
18+ return render_template ('index.html' , user = session ["user" ])
2219
2320@app .route ("/login" )
2421def login ():
@@ -48,7 +45,7 @@ def authorized():
4845
4946@app .route ("/logout" )
5047def logout ():
51- session ["user" ] = None # Mark current session as not-logged-in
48+ session ["user" ] = None # Log out from this app from its session
5249 # session.clear() # If you prefer, this would nuke the user's token cache too
5350 return redirect ( # Also need to logout from Microsoft Identity platform
5451 "https://login.microsoftonline.com/common/oauth2/v2.0/logout"
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ </ head >
6+ < body >
7+ < h1 > Microsoft Identity Python Web App</ h1 >
8+ Welcome {{ user.get("name") }}!
9+ < li > < a href ='/graphcall '> Call Microsoft Graph API</ a > </ li >
10+ < li > < a href ="/logout "> Logout</ a > </ li >
11+ </ body >
12+ </ html >
13+
You can’t perform that action at this time.
0 commit comments