First steps
Hi
I’ve followed the first steps tutorial, but no matter; “User has no backend access.”
Has it been updated recently?
Hi, in order to log into the Backend User Interface, the new user must have the isAdmin flag set to true, does that help?
Thank you Christian.
1) Ok, so the user should not be verified by the normal login procedure?
2) When I’m logged in by admin, I click on the like on the page at it takes me to; http://ip:port/projects. That works. If I open a private tab in the browser and paste the same link in, I get;
HTTP ERROR 404 Not Found
URI: http://ip:port/structr/html/projects
STATUS: 404
MESSAGE: Not Found
How am I supposed to test it? The tutorial just end without verifying that it works.
There is a (deliberate) difference between admin users (who can use the admin backend) and non-admin users.
Non-admin users need to log in via a login form in your frontend like this:
<form method="post" enctype="application/x-www-form-urlencoded" action="/structr/login?target=<name of the target page>">
<input type="text" name="name">
<input type="password" name="password">
<button>Login</button>
</form>
After logging in, the page is still not visible because it must be made visible for authenticated users, and only after that, non-admin users can see the page.
Does that make sense?
Disregarding the fast that the first step tutorial mentions nothing about this (?) - I’ve managed to make a login page and make it visible for non-authenticated users.
At this point, without a tutorial, I’m just guessing how to wire it up to the /projects page.
Any more pointers? :-)
Did you try “Create Page” and then select “Sign-in Page”?
You can then add Event-action Mapping (tab “Events”) and wire the form or input fields.
Thank you for your answer!
Yes, I’ve made a couple of login pages to test the functionality. One by manually inserting a form like Christian wrote and another by modifying the sign in template to include a form. Since the template does not contain a form per default, I guess it does not need it and I can wire the code up some other way than using a form?
Also, is there a more comprehensive example somewhere? I find the docs very light on examples so it would be very helpful to see how to achieve the most common and basic functionality. For example, to use the logout functionality, how would I go about changing the logout text in the header under the profile to actually post to the backend rest endpoint? Is the procedure to add some element at that location and wire it up to some submit function? Where do I read about this? Where can I see examples?
I can do all these things manually ofc (either posts, vanilla javascript or using something else), but my interest is to see how it would be done the structr way.