Skip to content

[Feedback]: Early usage testing #79

@wellington-vell

Description

@wellington-vell

First off, thank you for developing this library. I had been looking for something like better-auth for the go ecosystem for a while and really appreciate the work that has gone into it.

This feedback is based on comparing authula's directly against better-auth.

Missing Fields

Session Object

  • impersonated by: There is currently no way to track when a session is being impersonated by another user.

User Object

  • banned
  • banReason
  • banExpires

Adding these fields to the User object would eliminate the need for an extra backend query and manually creating a map of banned users on the frontend. We currently have to fetch users and banned states separately, then merge them into a Map<string, AdminUserState> just to know who is banned. If banned, banReason, and banExpires lived on the user model directly, this would be unnecessary.

Type Mismatch: metadata Field

The metadata field on models like User, SignUpRequest, CreateUserRequest, and UpdateUserRequest is typed as json.RawMessage in Go. This causes issues with OpenAPI/Swagger generation tools (like swaggo) that interpret json.RawMessage (which is []byte under the hood) as an array of integers rather than an arbitrary JSON object.

  • Generated OpenAPI Spec: metadata is documented as "type": "array", "items": {"type": "integer"} instead of a free-form object.
  • TypeScript Client Generation: Tools like @hey-api/openapi-ts produce Array<number> for metadata, which conflicts with the authula TypeScript SDK's expected type of Record<string, unknown>.

Frontend SDK

Unlike better-auth, whose SDK exposes a similar interface that works in a similar way than TanStack Query, the authula SDK had to be wrapped manually to gain access to lifecycle hooks like onSuccess, onError, and query states. This extra layer adds boilerplate.


The sdk is not really a problem for me since i can bypass it with my current setup with orpc + hey api integration for generating the sdk for the frontend. But i am sure that would be a better user experience

If i said something wrong, or want feedback on other stuff let me now 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions