[GH-ISSUE #156] Protect API routes #25475

Closed
opened 2026-04-17 15:42:45 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @moshetanzer on GitHub (Oct 12, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/156

Hi,

How do you protect api routes in nuxt use better auth? Also can you do it using rbac?

Originally created by @moshetanzer on GitHub (Oct 12, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/156 Hi, How do you protect api routes in nuxt use better auth? Also can you do it using rbac?
GiteaMirror added the locked label 2026-04-17 15:42:45 -05:00
Author
Owner

@Bekacru commented on GitHub (Oct 13, 2024):

You can secure it by checking the session with auth.api.getSession. For RBAC, you can use the organization plugin. If you only need admin and user roles, you can also just use the admin plugin or define custom fields instead.

<!-- gh-comment-id:2408869327 --> @Bekacru commented on GitHub (Oct 13, 2024): You can secure it by checking the session with `auth.api.getSession`. For RBAC, you can use the `organization` plugin. If you only need `admin` and `user` roles, you can also just use the admin plugin or define custom fields instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#25475