Skip to content

Commit

Permalink
adapt
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Jun 1, 2024
1 parent 85dfd9d commit 55c2dd9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions examples/oauth_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
##################################################################################################
## !!! important things to adapt to your needs !!!
##################################################################################################
CLIENT_ID='xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com'
CLIENT_SECRET='GOXXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxx'
GOOGLE_CLIENT_ID='xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com'
GOOGLE_CLIENT_SECRET='GOXXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxx'
REDIRECT_URI = "http://localhost:8000/oauth_auth" #<= should be declared in your console !!!
##################################################################################################

Expand All @@ -17,8 +17,8 @@
OAUTH = OAuth()
OAUTH.register(
name='google',
client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
client_id=GOOGLE_CLIENT_ID,
client_secret=GOOGLE_CLIENT_SECRET,
server_metadata_url='https://accounts.google.com/.well-known/openid-configuration',
client_kwargs={
'scope': 'openid email profile',
Expand Down Expand Up @@ -59,13 +59,13 @@ def user(self): # -> dict or empty dict

def render(self): # dynamic rendering
self.clear()
self+= self.title + self.btn
self <= self.title + self.btn
if self.user:
self.title.set(self.user['name'])
self.btn.set("SignOut")
self.title.clear(self.user['name'])
self.btn.clear("SignOut")
else:
self.title.set("")
self.btn.set("SignIn")
self.title.clear()
self.btn.clear("SignIn")

def onclick(self,o:Tag.button):
if self.user:
Expand Down Expand Up @@ -93,7 +93,7 @@ def render(self): # dynamic rendering
# **IMPORTANT** current host serving on SSL
# on your localmachine, switch ssl to False !!!
#/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
app=Runner(App,ssl=True)
app=Runner(App,ssl=False)

app.add_route("/oauth_{action}", oauth_request_action )

Expand Down

0 comments on commit 55c2dd9

Please sign in to comment.