Skip to Content
Menu
This question has been flagged
2 Replies
3947 Views

Hi all,


Currently busy with building a website for our start-up and I am looking into making some of our pages only accessible to users that are logged in. I managed to do this via This page>Propterties>Publish>Visibility>Signed in. This works as intended, but right now, when you are not logged in, you only get to see the


403: Forbidden

The page you were looking for could not be authorized.


text, but this will be confusing for our customers. Is it possible that we change this text (or redirect to a login page) to make this more clear? If so, what is the best way to do this?


Thanks in advance!

Avatar
Discard
Best Answer

HI, 

You can customize the text or redirect the users to a login page when they encounter a "403: Forbidden" error message. 

Here's how you can achieve this:

<template id="inherit_403_page" inherit_id="http_errors.403">


  <xpath expr="//div[@class='container']" position="replace">    <h1 class="mt32">///ModifyHere//</h1>


    <p>You need to be logged in to access this page. Please <a href="/web/login">log in</a> or <a href="/web/signup">sign up</a> to continue.</p>


  </xpath>


</template>


In this example, we're creating a new template with the ID "inherit_403_page" and specifying the "inherit_id" attribute to inherit from the original template with the ID "http_errors.403". 

Make sure to update the `href` values in the `` tags with the correct URLs for your login and signup pages.

Regards

Avatar
Discard
Best Answer

How can i create the template on odoo? 

Thank you

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 24
1298
0
Dec 22
1723
0
Jun 22
328
0
Jun 21
2305
9
Jul 20
10436