Hi Fam
Download
One is able to perform User Authentication using Email / Password combination in PocketBase. The user must be defined in the users collection in pocketbase.
The project in the download is a B4J / BANano based project that shows one how to perform user authentication using an email and a password.
1. The administrator user is admin@pocketbase.com and password is admin@pocketbase.com123! This is the same as a user in the users collection
2. The user details are stored in the beautify.json file of the project. This is used to create other users in the app.
3. A user must exist on the users table to be able to log in usign their credentials.
4. To run the demo, double click the bat file, this login screen will appear, login using admin@pocketbase.com and admin@pocketbase.com123!
This template can be used to create Pocketbase based WebApps with user authentication.
For the forgot password screen to work, email settings should be set on pocketbase. You can use your SMTP details for that.
This is the example of the sign in code
You can use this guide.
github.com
Related Content
www.b4x.com
Download
One is able to perform User Authentication using Email / Password combination in PocketBase. The user must be defined in the users collection in pocketbase.
The project in the download is a B4J / BANano based project that shows one how to perform user authentication using an email and a password.
1. The administrator user is admin@pocketbase.com and password is admin@pocketbase.com123! This is the same as a user in the users collection
2. The user details are stored in the beautify.json file of the project. This is used to create other users in the app.
3. A user must exist on the users table to be able to log in usign their credentials.
4. To run the demo, double click the bat file, this login screen will appear, login using admin@pocketbase.com and admin@pocketbase.com123!
This template can be used to create Pocketbase based WebApps with user authentication.
For the forgot password screen to work, email settings should be set on pocketbase. You can use your SMTP details for that.
This is the example of the sign in code
B4X:
Private Sub btnSignIn_Click (e As BANanoEvent)
e.PreventDefault
'reset the validations
mdlSignIn.ResetValidation
'validate each of the elements
mdlSignIn.Validate(email.IsBlank)
mdlSignIn.Validate(password.IsBlank)
'check the form status
If mdlSignIn.IsValid = False Then
app.ShowSwalError("Please provide all required information!")
Return
End If
'
app.pagepause
dblUsers.Initialize(Me, "dbusers", Main.ServerIP, "users")
banano.await(dblUsers.USER_AUTH_WITH_PASSWORD(email.value, password.value))
Dim up As profileType = dblUsers.UserProfile
If up.Size = 0 Then
app.pageresume
app.ShowSwalError("These login details could not be authenticated, please contact Admin!")
Return
End If
'get the data on form
Dim data As Map = mdlSignIn.GetData
'do we remember
If rememberme.Checked Then
'save settings using app name
SDUIShared.SetLocalStorage(Main.AppName, data)
Else
'remove settings
SDUIShared.DeleteLocalStorage(Main.AppName)
End If
'show nav & drawer
pgIndex.UpdateUserName(up.name)
pgIndex.UpdateUserAvatar(up.avatar)
pgIndex.IsAuthenticated(True)
'hide the modal
mdlSignIn.Hide
app.PageResume
End Sub
You can use this guide.
gmail test mail timeout · pocketbase pocketbase · Discussion #458
I still don't know if this is a bug. When trying to setup gmail as smtp.gmail.com the UI throws a Test email send timeout. error. I've created an App password for mail in a google account and teste...
Related Content
[Web] Mastering Pocketbase: Your Ultimate Guide to a Flawless SQLite WebServer Install on Windows!
Hi Fam Download PocketBase is a SQLite Webserver with some powerful functionality. Whilst it provides functionality to be a database, it also has a nice UI to manage that database. You can host it locally and also run it on a VPS. It does not support shared hosting. 1. Download and unzip this...