mirror of
https://github.com/allankoechke/pocketbase-cpp.git
synced 2026-12-02 09:37:16 +00:00
Authentication endpoints updated [Verify user, request email verification, password reset, etc]
This commit is contained in:
23
main.cpp
23
main.cpp
@@ -1,14 +1,31 @@
|
||||
#include <QCoreApplication>
|
||||
#include "sdk/client.h"
|
||||
// #include "sdk/RecordService.h"
|
||||
#include "sdk/services/recordservice.h"
|
||||
#include "sdk/services/baseauthstore.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
PocketBase client{"http://127.0.0.1:5740/"};
|
||||
qDebug() << client.lang();
|
||||
// client.collection("users")->authWithPassword("user@email.com", "123456789");
|
||||
|
||||
// Auth with password
|
||||
client.collection("users")->authWithPassword("test@user.com", "123456789");
|
||||
// qDebug() << client.authStore()->isValid() << user.isValid();
|
||||
// qDebug() << client.authStore()->token();
|
||||
// qDebug() << client.authStore()->model()->getId();
|
||||
// qDebug() << client.authStore()->model()->repr();
|
||||
|
||||
// Auth Refresh
|
||||
//auto refreshUser = client.collection("users")->authRefresh();
|
||||
//qDebug() << refreshUser.isValid();
|
||||
|
||||
// Request Verification
|
||||
// client.collection("users")->requestVerification("allankoech.ke@gmail.com");
|
||||
|
||||
qDebug() << client.collection("users")->confirmVerification("12345");
|
||||
|
||||
qDebug() << client.collection("users")->requestPasswordReset("allankoech.ke@gmail.com");
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user