Re: custom auth

2019-03-07 Thread Ash Berlin-Taylor
The problem is you are creating a new User record, which maps to an INSERT statment every request/log in. Instead you should query first to find the record. Something like this: user = session.query(models.User).filter( models.User.username == username).first() if not

Re: custom auth

2019-03-06 Thread Sudhir Babu Pothineni
Hi Devs, We have our own users database, I am doign liek this to authenticate: try: cred = authenticate(session, username, password) if cred: user = models.User( username=username, is_superuser=False) user.is_active=True session.merge(user)