Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

60 Commits

Folders and files

Repository files navigation

gd-pocketbase

Normalises PocketBase auth responses for Godot 4.

AuthResponseModule.normalize() turns either a native PocketBase {"token", "record"} response or a trusted backend-proxy {"access_token", "user"} response into one shape: {"access_token", "user": {"id", "email", "username"}}. That is the whole addon. The session store, client ID and JWT helpers it used to carry were a copy of a backend-neutral core that now lives in @aviorstudio/gd-session; install that beside this addon to persist what normalize() returns.

Installation

gdam add @aviorstudio/gd-pocketbase
gdam add @aviorstudio/gd-session

Quick start

const AuthResponseModule = preload(
	"res://addons/@aviorstudio_gd-pocketbase/src/auth_response_module.gd"
)
const SessionStoreModule = preload(
	"res://addons/@aviorstudio_gd-session/src/session_store_module.gd"
)

var auth := AuthResponseModule.normalize(response_json)
var config := SessionStoreModule.SessionStoreConfig.new()
config.native_adapter = NativeCredentials.new()  # see gd-session's README
var saved := SessionStoreModule.new(config).save(auth)
if not saved.is_ok():
	push_error(saved.detail)

Games own HTTP transport, refresh and revoke policy, and server trust. A production backend should keep PocketBase superuser credentials private; this addon never needs them.

License

See LICENSE.

Contributor checks

Install mise, then prepare the pinned development helpers and run the complete native gate:

git clone https://github.com/nicodes/tools.git .ci-tools
git -C .ci-tools checkout --detach f7e243524ce2aa29f299e4c79db33001f72f4a30
mise install
mise run check

mise.toml owns tool versions and tasks. Engine and template downloads are checksum verified. mise run build packages the addon; mise run test runs its declared tests. The complete check also validates the installed artifact. Build and test receipts stay in .artifacts/verification.

Contributor task interface

Contributor tool versions and task entry points live in the native Mise configuration. Use mise run lint for source checks, mise run test for the applicable behavioral tests, and mise run check for the complete supported gate. mise run clean removes declared generated outputs while preserving source, credentials and retained data. This package has no application development service.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages