auth-web-cloudbase

Implement CloudBase frontend authentication flows with OTP verification and session management.

Updated May 14, 2026
One-click install
npx skills add https://github.com/williamwang25/ams-admin --skill auth-web-cloudbase-williamwang25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-web-cloudbase
Source: https://github.com/williamwang25/ams-admin/tree/main/.windsurf/skills/cloudbase/references/auth-web
Command: npx skills add https://github.com/williamwang25/ams-admin --skill auth-web-cloudbase-williamwang25

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

CloudBase Web projects often struggle with getting reliable login, OTP verification, session persistence, and protected-route checks working correctly—especially when frontend teams use the wrong SDK calls or validate login state incorrectly.

Core Features & Use Cases

  • Supabase-like Auth API: Provides consistent { data, error } patterns across sign-in, sign-up, sign-out, session handling, and user/profile operations for frontend teams.
  • Multiple login methods: Supports username/password, phone OTP, email OTP, OAuth, custom ticket, and ID-token flows with the right wiring patterns for each.
  • Reliable auth guards: Guides correct use of auth.getSession() instead of deprecated or misleading login-state checks, preventing routes from granting access without a real session.
  • User management: Covers update profile, change/reset password, identity linking/unlinking, account deletion, and auth state change subscriptions.
  • Use Case: You’re building an admin dashboard in Vue/Vite and need a working login/register flow (including OTP) plus a protected route that only opens after a confirmed CloudBase session exists.

Quick Start

Wire a CloudBase Web login flow for your existing frontend by initializing @cloudbase/js-sdk with a publishable key, then implement username/password or OTP send+verify and protect routes using getSession().

Frequently Asked Questions about auth-web-cloudbase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement CloudBase web authentication in a Vue or React SPA?

To implement CloudBase web authentication, initialize the @cloudbase/js-sdk with a publishable key and use Supabase-compatible method signatures for sign-in, sign-up, and session management. This approach provides reliable auth flows for Vue/React/Vite-style frontends.

Why does my CloudBase protected route allow access without a valid session?

Protected routes fail when using deprecated or misleading login-state checks instead of auth.getSession(). You must validate access using auth.getSession() to accurately detect a real session and prevent unauthorized route entry in CloudBase web apps.

How do I set up phone OTP verification with @cloudbase/js-sdk?

Phone OTP verification with @cloudbase/js-sdk requires sending an OTP code and subsequently verifying it. The process uses Supabase-compatible patterns returning consistent data and error objects for reliable frontend integration.

Can I use Supabase-compatible auth method signatures with a CloudBase environment?

Yes, CloudBase authentication can be implemented using Supabase-compatible method signatures. This provides a consistent data and error pattern across sign-in, sign-up, session handling, and user profile operations for frontend teams.

What do I need before adding OAuth login flows to a CloudBase web app?

Before adding OAuth login flows, you need an existing CloudBase environment with providers already enabled and a publishable key available. The frontend must use @cloudbase/js-sdk to wire the authentication correctly.