Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] #109

Closed
Kludex opened this issue May 26, 2020 · 1 comment
Closed

[QUESTION] #109

Kludex opened this issue May 26, 2020 · 1 comment
Labels
question Question or problem

Comments

@Kludex
Copy link
Sponsor

Kludex commented May 26, 2020

Description

Is it possible to add a new field to the OAuth2PasswordRequestForm?

Additional context

I need to add a new optional field called new_password in the following Request Body:
WhatsApp Image 2020-05-26 at 19 26 29

What I was trying to do:

class LoginForm(OAuth2PasswordRequestForm):
    def __init__(self, new_password: str = Form(None)):
        super().__init__()
        self.new_password = new_password

But it overwrites what is there and just show the new_password:
image

@Kludex Kludex added the question Question or problem label May 26, 2020
@Kludex Kludex closed this as completed May 31, 2020
@tiangolo
Copy link
Owner

tiangolo commented Jun 7, 2020

I guess you intended to ask this in FastAPI... 😄 thanks for closing it here 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
Projects
None yet
Development

No branches or pull requests

2 participants