Skip to Content
Menu
This question has been flagged
1675 Views

Hi, everyone, when I was using a third-party login integrated with odoo12, I encountered a problem that I could not jump to the main interface of odoo. Error 403 did not have permission to access resources. What should I do to get to the odoo main interface correctly?

Below is my part of the code:

 

    def _do_post_login(self, user, redirect):
        """
        After all the verifications are completed and correct, the interface needs to jump to the main interface.
        :param user:  user-Object
        :param redirect:
        :return:
        """
        ensure_db()
        request.params['login_success'] = False
        if request.httprequest.method == 'GET' and redirect and request.session.uid:
            return http.redirect_with_hash(redirect)
        if not request.uid:
            request.uid = odoo.SUPERUSER_ID
        values = request.params.copy()
        try:
            values['databases'] = http.db_list()
        except odoo.exceptions.AccessDenied:
            values['databases'] = None
        old_uid = request.uid
        uid = request.session.authenticate(request.session.db, user.login, user.password)
        if uid is not False:
            request.params['login_success'] = True
            if not redirect:
                redirect = '/web'
            return http.redirect_with_hash(redirect)
            # return http.local_redirect(redirect)
        request.uid = old_uid
        return self._do_err_redirect("The user does not exist or the user information is incorrect. The login cannot be completed. Please contact the administrator.。")



Avatar
Discard