Using pyramid authentication with pyramid

前端 未结 1 833
失恋的感觉
失恋的感觉 2021-02-02 02:11

In the pyramid documentation, the Sqlalchemy Dispatch Tutorial uses dummy data in security.py. I needed to use mysql data so I implemented it like this:

1条回答
  •  一向
    一向 (楼主)
    2021-02-02 02:48

    You have the idea right.

    Your groupfinder is broken right now. Notice you have a for-loop with a return statement inside. The groupfinder should return at least an empty list [] if the user is valid. Only return None if the user is invalid.

    Also an md5 of the password is pretty crappy these days. Look at the cryptacular or passlib libraries for performing a cryptographic hash instead via bcrypt.

    0 讨论(0)
提交回复
热议问题