Skip to content

Commit

Permalink
access ClerkState from within other State
Browse files Browse the repository at this point in the history
  • Loading branch information
Dach Stein committed May 29, 2024
1 parent e4cdc81 commit 3bc9272
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions reflex_template/reflex_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
class State(rx.State):
"""The app state."""

def handle_get_code(self) -> rx.Component:
logger.info("a user gets the code!")
async def handle_get_code(self) -> rx.Component:
clerkstate = await self.get_state(clerk.ClerkState)
logger.info(
f"user {clerkstate.user.email_addresses[0].email_address} gets the code!"
)

return rx.redirect(
"https://github.com/dentro-innovation/reflex_template", external=True
Expand Down

0 comments on commit 3bc9272

Please sign in to comment.