scotch/engineauth

Example handlers.py is incomplete

Closed this issue · 4 comments

In particular, the Account and Password handlers appear to be missing.
It's possible that these are picked up by the middleware module, but it seems unclear if that's the case.

If the example is still a work in progress, it might be worthwhile to add it to your TODO file, or add individual TODOs into example/handlers.py

@erichiggins sorry of the late response. Yes the middleware handles the password strategy. The form in the example app POST to "/auth/password" which is handled by the middleware.

Looking a the pasword strategy might help clarify what's going:
https://github.com/scotch/engineauth/blob/master/engineauth/strategies/password.py#L58

Essentially the password strategy takes an email and a password string, and does one of three three things.

  1. If the email address is not in the system it creates a new user with the provided email and password.
  2. If it is in the system it checks the password. If the password is correct it logs in the User.
  3. If the password is incorrect, it rejects the login.

Does that help at all?

I was more curious about why main.py routes URL paths (e.g. '/settings/') to non-existant handlers (e.g. 'handlers.AccountIndexHandler').

Ah, I forgot that was there. Yes, originally I intended to include that functionality in the example, but it was never completed. Thank you for reporting it, I've removed those lines.

Great, thanks!