Simple Login System
In this lesson we will teach you how to create a simple login system that can be used on your stack. Although this is a simple method of implemeting such a feature, it can be built upon to create more advanced systems
Create a new stack
Setup accessed card
Create Login card elements
Edit the script of the card
Place the following in your card script
local sUsername, sPassword
put "johnsmith" into sUsername
put "pa55word" into sPassword
if field "username" is sUsername and field "password" is sPassword then
answer "Login Successful"
go to card "accessed"
answer "Details Incorrect. Please try again!"
Test the Script
The above script puts a defined username and password into a variable and then the loginCheck handler checks if the contents of the username and password fields matches these values.
If a match is successful then you progress to the next card. However, if details are in-correct then an answer dialog is shown.