Opened 8 years ago

Closed 7 years ago

Last modified 6 years ago

#8274 closed (fixed)

Auth views should allow form customization

Reported by: Julien Phalip Owned by: Julien Phalip
Component: contrib.auth Version: master
Severity: Keywords:
Cc: philipe.rp@…, Dave Naffziger, bthomas@…, Freark van der Bos, steph, graham@…, michel@…, ben@…, MonteDavidoff, bas@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

It is possible to make your own authentication backend. However, if you want to authenticate with usernames longer than 30 characters (e.g. emails) you cannot rely on the login view, since it's bound to use the AuthenticationForm, which itself only allows 30 characters usernames. You could easily find a way around if only the form was customizable.

Curiously, some views already allow form customization -- password_reset_confirm and password_reset -- but the others don't -- login and password_change --. The attached patch fixes the latter.

Attachments (2)

8274.auth_forms.diff (2.3 KB) - added by Julien Phalip 8 years ago.
authentication_form.diff (8.8 KB) - added by Chris Beaven 8 years ago.

Download all attachments as: .zip

Change History (19)

Changed 8 years ago by Julien Phalip

Attachment: 8274.auth_forms.diff added

comment:1 Changed 8 years ago by Malcolm Tredinnick

milestone: 1.01.0 maybe
Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Julien Phalip

Just a note: the same request has been checked in for password reset views, see #6905.

comment:3 Changed 8 years ago by Jacob

milestone: 1.0 maybepost-1.0

comment:4 Changed 8 years ago by Julien Phalip

Owner: changed from nobody to Julien Phalip
Status: newassigned

#9168 was closed as dupe but contains a good addition to the docs for custom auth backends.

Changed 8 years ago by Chris Beaven

Attachment: authentication_form.diff added

comment:5 Changed 8 years ago by Chris Beaven

Triage Stage: AcceptedReady for checkin

Ok, here's a patch with both changes and docs.

It also makes the password_change_form use keyword arguments for niceness (and patch is a bit bigger because my editor strips trailing whitespace).

comment:6 Changed 8 years ago by Dave Naffziger

Cc: Dave Naffziger added

comment:7 Changed 8 years ago by Bob Thomas

Cc: bthomas@… added

comment:8 Changed 8 years ago by Freark van der Bos

Cc: Freark van der Bos added

comment:9 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:10 Changed 8 years ago by steph

Cc: steph added

comment:11 Changed 8 years ago by anonymous

Cc: graham@… added

comment:12 Changed 8 years ago by Felipe 'chronos' Prenholato

Cc: philipe.rp@… added

comment:13 Changed 7 years ago by Michel Sabchuk

Cc: michel@… added

comment:14 Changed 7 years ago by jamstooks

Cc: ben@… added

Any plans on adopting this? Does this need to be associated with a milestone again to get checked in?

comment:15 Changed 7 years ago by MonteDavidoff

Cc: MonteDavidoff added

comment:16 Changed 7 years ago by Luke Plant

Resolution: fixed
Status: assignedclosed

Implemented in r11618

comment:17 Changed 6 years ago by Vasily Ivanov

Cc: bas@… added
Note: See TracTickets for help on using tickets.
Back to Top