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

Override EmailAuthSerializer to add custom fields. #93

Closed
fabiom91 opened this issue Jul 2, 2021 · 1 comment
Closed

Override EmailAuthSerializer to add custom fields. #93

fabiom91 opened this issue Jul 2, 2021 · 1 comment

Comments

@fabiom91
Copy link

fabiom91 commented Jul 2, 2021

Is it possible to override this class to allow adding other custom fields?
e.g. In my case is an administrator who register the user email. I already modified the send_email_with_callback_token function to include the token into a link but I also want to be able to add other custom codes to the link so that the user will be redirected appropriately based on the administrator wishes.

How do I override this class to add some more serialisers fields? Thanks.

class EmailAuthSerializer(AbstractBaseAliasAuthenticationSerializer):
    @property
    def alias_type(self):
        return 'email'

    email = serializers.EmailField()
@bprachi27
Copy link

you can inherit EmailAuthSerializer and make your serializer.
i also implement like this. then I override view and make my own url and it worked really fine

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

No branches or pull requests

2 participants