Buy Now
Sign in

Login via REST before showing form

huubs , July 14 2021, 07:41
H
huubs 100
July 14 2021, 07:41 #396817
Hello, I'd like to add a login functionality before my form display. This login goes via an external REST api, I send the login details, and the REST api sends me a number back that I have to add to the form if the login is succesful. But I am not sure how to proceed.
I think I need to use Javascript to send the details to the REST api, and then display the form. But the thing is, I don't want the form to be displayed at all before the login (so that spammers or anyone can't fill in the form) anyone has an idea how to do this the best way?
H
huubs 100
July 14 2021, 11:07 #396819
Okay so I have added an event switcher that runs the REST code and succesfully displays the form if the username and passwords are correct. But now I need to show a username and password box to let the user fill in these values. Do I need to make another form for this (2 forms? )
GreyHead 65
July 16 2021, 20:13 #396835
Hi huubs,
You can use a multi-page form where the first page shows just the Login inputs, when that submits you can switch either to the full form or back to the Login.
Bob
If you'd like to buy me a coffee or two, thank you very much