Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1243 มุมมอง

Hi everyone,
In this controller even after I enter the correct email and password the page stills the same and doesn't redirect to the hdashboard page, Why is that ?


 @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

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', {'error': str(e)})
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
How to compare user id and partner_id? แก้ไขแล้ว
1
ส.ค. 22
3601
1
ต.ค. 23
2833
2
ส.ค. 25
2343
Controller not working แก้ไขแล้ว
2
มิ.ย. 25
671
1
มิ.ย. 25
1707