Private Sub mdlLogin_Yes_Click (e As BANanoEvent)
e.PreventDefault
If txtServer.IsBlank Then Return
If txtServer.IsValidUrl = False Then Return
If txtEmailAddress.IsBlank Then Return
If txtEmailAddress.IsValidEmail = False Then Return
If txtPassword.IsBlank Then Return
If txtPassword.IsMinLength(12) = False Then Return
If txtPassword.IsStrongPassword = False Then Return
'save the details to localstorage
If chkRememberMe.Checked Then
Dim srememberKey As String = $"${Main.appname}remember"$
Dim rmap As Map = CreateMap()
rmap.put("email", txtEmailAddress.Value)
rmap.put("pwd", txtPassword.Value)
rmap.put("server", txtServer.Value)
'convert to json
Dim sremember As String = BANano.ToJson(rmap)
'encrypt using api key
Dim sout As String = BANano.Await(app.UI.AESEncrypt(sremember, Main.APIKey))
'store encrypted data
BANano.SetLocalStorage2(srememberKey, sout)
End If
mdlLogin.YesLoading = True
Sleep(3000)
mdlLogin.YesLoading = False
End Sub