everyone
In this controller after correct login the controller should redirect me to the dashboard, but its not working for some reason, there is no error message or traceback
`@http.route(‘/login/process’, type=’http’, auth=’public’, methods=[‘POST’], website=True, csrf=False)
def login_process(self, **post):
email = post.get(’email’)
password = post.get(‘password’)
db = request.env.cr.dbname
<code> try:
user = request.env['res.users'].sudo().search([('login', '=', email)])
if user and user.password == hashlib.sha256(password.encode()).hexdigest():
uid = user.id
request.session.authenticate(db, email, password)
print("**********************************")
return redirect('/')
else:
raise ValidationError('Invalid email or password')
except ValidationError as e:
return http.request.render('test.test_view_form', {'error': str(e)})`
</code>
<code> try:
user = request.env['res.users'].sudo().search([('login', '=', email)])
if user and user.password == hashlib.sha256(password.encode()).hexdigest():
uid = user.id
request.session.authenticate(db, email, password)
print("**********************************")
return redirect('/')
else:
raise ValidationError('Invalid email or password')
except ValidationError as e:
return http.request.render('test.test_view_form', {'error': str(e)})`
</code>
try:
user = request.env['res.users'].sudo().search([('login', '=', email)])
if user and user.password == hashlib.sha256(password.encode()).hexdigest():
uid = user.id
request.session.authenticate(db, email, password)
print("**********************************")
return redirect('/')
else:
raise ValidationError('Invalid email or password')
except ValidationError as e:
return http.request.render('test.test_view_form', {'error': str(e)})`
I have tried overriding the whole res.users authenticate method and its still not working and also there is no error message or traceback