Restricted pages on application builder (user auth)

I’ve successfully managed to create a user source for my application.

On the homepage, I’ve added a login form and mapped it to the previously made user source.

Once successfully logged in, there is no redirect or change in appearance to the page.

Page settings has no option to restrict to logged in users.

Hi,

Welcome to the community. I hope you enjoy working with the app builder.

After authenticating a user, the login form should disappear and show just a logout button instead. But it is true that there is no redirect to a next page or a way to mark a page as restricted.

This means that you need to make sure that the data sources on restricted pages always check for an authenticated user. You can simulate the result with the View as functionality on top.

Thanks for the reply.

It seems it’s working as intended, and user learning is at fault. You’ve lost me at

You need to make sure the data sources on restricted pages always check for an authenticated user.

Is there an example somewhere I can reference?

We are currently working on tutorial videos and templates for the application builder.

Meanwhile, this might help you.

Assume that I have a page to show projects. On that page, a client / customer can only see it’s own projects. So, you need to include this in your data source like this:
image

If the user is not authenticated, he will only see an empty table

If the user is authenticated, he sees his only his own projects

I can’t seem to replicate.

Is there any plans to make the entire page require application authentication?

As it stands, even if I was able to make it work… If I’m understanding the current limitations, I would have to make the entire app. (Links, headings, buttons, etc.) as a table in the backend first?

I think part of my problem is that the auth table is independent of the table data I’m trying to display. I did attempt to link the tables, and when I was able to apply the filter with the linked column… it would show ANY user the rows if it contained the “User”.

Not sure if I should make another topic, but the other issue I’ve been trying to tackle is, when I have a linked column it won’t display the text, but rather is returning [object, Object]

I’m really looking forward to making my app building dreams come true and enter the contest.

Thank you for all that you do

Hi,

Thank you so much for assisting us, it’s really helpful!
In my case, the log-in form doesn’t disappear. Am I missing something?

Thank you so much for assisting us, it’s really helpful!
In my case, the log-in form doesn’t disappear. Am I missing something?

Hi,

The login form doesn’t disappear anymore in the latest release. But you know have the option to navigate to a different page after authenticating and trigger a logout action.
image

For the next release, it will be possible to set the visibility of the form yourself.

1 Like

Thanks for the update and it’s all clear!
It worked successfully with “Open Page” after logging in :pray:

Is this a feature in the latest development branch? I’m self-hosting 1.23.2 but I don’t have the option to set any events for login. This is preventing me from being able to set a timed authentication token so that they don’t have to login every time they reload the page. This severely limits the usefulness of the login element.

Any help with this would be much appreciated, it’s the last step I need to get sorted out before I can start some trial implementation of my web app.

Is this a feature in the latest development branch? I’m self-hosting 1.23.2 but I don’t have the option to set any events for login

Yes, the development branch even has the visibility option since this weekend.

Thanks for the reply, trying it out right now!

It’s working great so far, but I do have another related question: how is the “isAuthenticated” field handled? Is it only flipped after a logout function has been called through a button action, or is there also a timeout on it?

I need to test it in depth myself, but the field isAuthenticated should be updated after the login expires.

I did confirm it appears to expire and update isAuthenticated. Any chance you know the timer on the login expiry? I just left it logged in and then checked in the morning and I can’t find any documentation on how long it lasts.

I think it is 10 minutes.
@jrmi : can you confirm / confute this?

The login should last as long as the Baserow login. By default it’s 7 days. The 10 minutes is for the short live token with is renewed with the long live token.

The isAuthenticated is updated as soon as the token expire or the user logout.

Let me know if it’s not the case.

Thanks for the reply! I can finish my login events table with the correct timeout period now! I think a week timeout works well for my purposes too.

I don’t think that’s a good practise. If the user is not authenticated, it should (to my humble opinion) just show a page that says Access Denied or refer straight back to the login page.

@360Creators : I totally agree.

The issue is solved in the next release where you will be able to show or hide elements based depending if a user is logged in or not.

image

I can confirm, I’ve been using the docker development image for the past few days and it works great! I have rebuilt one of my apps using the visibility to restrict page content to logged in users and give links to login pages for logged out visitors. I can handle redirect logic simply by having multiple login pages with different on event URLs and can handle elevated privileges via datasource filters on access control list fields to show/hide table data based on the username of the current authenticated user. It ended up being a much more clean and proffesional looking UI experience then how I was doing such before. I also setup a workflow on n8n which combined with a few extra fields and another table have a full login and user event log to keep track of logged in users and account creation and deletion.