Accessing a variable contained in the state #3065
Closed
paul-stork
announced in
Q&A
Replies: 1 comment 1 reply
-
When do you want to validate them, when they submit the form? I recommend going through the local auth app. You should be able to authenticate in an event handler. class FormState(rx.State):
current_user_info: UserInfo = UserInfo(
current_user='',
user_pass = ''
)
def authenticate(self):
# Call your api here
is_valid = my_api(self.current_user, self.user_pass) You can then call the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Good day!
I have a question for those who are much smarter than I...
I'm currently working on a proof of concept app that accesses 3 API's that all use the same set of credentials.
I currently get the credentials from a form and then pass them to:
What I'm stuck on is figuring out how to use the credentials stored in the UserInfo base to authenticate the other two APIs on other pages without asking for their credentials over and over.
While I would prefer to save a JWT, and use that to authenticate: I can't right now.
Long story short: I need to access something stored in Base or State and be able to use it in my Python code to authenticate an API call and I'm lost.
Beta Was this translation helpful? Give feedback.
All reactions