Commit Graph

20 Commits (v1.2.0)

Author SHA1 Message Date
veypi d3137955c3 feat(auth): add SMS/email verification code support for registration
- Add validateRegisterCode function to verify codes during registration
    - Integrate Aliyun SMS SDK (dysmsapi-20170525) replacing placeholder
    - Make cookie names configurable via JWT CookiePrefix setting
    - Rename login type "phone" to "sms" for consistency
    - Add 1-minute TTL cache for setting values
    - Add $fetch wrapper replacing raw fetch calls across all UI pages
    - Add verification code inputs with countdown send buttons to register UI
    - Move CSS/JS assets from root.html to auth and default layouts
    - Add scope parameter to VBase permission check methods
    - Add i18n entries for verification code messages (zh/en)
    - Fix route guard to use next('/403') instead of router.push
2 weeks ago
veypi 5c542daba0 refactor(ui): Refactor VBase auth client with auto-refresh and onAuthSuccess
- Remove scope parameter from VBase constructor
    - Add _ensureAuth with smart refresh logic (refresh if stale >12min)
    - Add background token refresh timer (every 12 minutes)
    - Add centralized onAuthSuccess handler for all login flows
    - Remove axios response interceptor from env.js
    - Clean up timer and state on clear()
3 weeks ago
veypi 4c021e7e93 refactor(auth): Migrate token delivery to HttpOnly Cookie with version-based revocation
- Replace JWT in response body with HttpOnly Cookie (vb_access/vb_refresh) to prevent XSS token theft
    - Add Redis-based token version management with ±1 tolerance for multi-tab concurrent refresh
    - Implement strict refresh token rotation: version must match exactly, increment on each refresh
    - Simplify JWT Claims to only carry UserID + Type + Version, remove user profile fields
    - Remove session-based token tracking and cache blacklist in favor of version increment revocation
    - Remove getAuthHeaders, wrapAxios, wrapFetch, isExpired from frontend VBase client
    - Remove client-side token/localStorage management, frontend now relies on Cookie auto-attach
    - Add CookiePath config option and change default access token expiry from 24h to 15min
    - Update Vigo app initialization to use functional options pattern
    - Add empty-body cookie read fallback in refresh endpoint
3 weeks ago
veypi a63dc65ab6 refactor(ui): Rename $vbase to $auth across frontend
- Rename $mod.$vbase to $mod.$auth in env.js initialization
    - Add guard condition to prevent duplicate VBase initialization
    - Update all page and layout templates to use $auth instead of $vbase
    - Update route guard in routes.js to reference $mod.$auth
1 month ago
veypi 03a0afc727 feat(ui): Add user cache and batch fetch in VBase
- Add shared users cache object to VBase constructor
    - Add User(id) API for reactive user info lookup
    - Implement _flushUserRequests for batch POST /api/auth/users
    - Cache and sync current user into shared users cache
    - Clear users cache on logout
2 months ago
veypi 6552ebf832 refactor(ui): Migrate router guard from env.js to routes.js
- Move beforeEnter router guard logic from env.js to routes.js export function
    - Update $env references to $mod in env.js, ico.html, and layout/default.html
    - Export routes as function that receives $mod context for dependency injection
    - Remove router guard from env.js initialization module
2 months ago
veypi 92156dcd53 feat(auth): Improve permission system and role management
- Add Scope and Level fields to UserPermissionInfo response
    - Include role-based permissions in /auth/me endpoint
    - Implement diff-based permission sync for role initialization
    - Remove Scope field from Role model queries (create, patch, grant)
    - Add permission-based route guards in UI (perm: '*')
    - Fix register to return error on default role assignment failure
    - Fix token refresh to only fetch user when token exists
    - Fix code formatting in api/init.go (remove extra spaces)
3 months ago
veypi e627ab0726 feat(ui): Add OAuth callback page and improve auth flow
- Add new OAuth callback page with loading states and error handling
    - Create reusable icon component (ico.html) for SVG icons
    - Remove deprecated public.html layout, merge into default
    - Update login page with improved third-party auth integration
    - Add i18n translations for OAuth-related messages
    - Update routes to include callback page and handle auth redirects
    - Enhance vbase.js with OAuth utilities and token management
3 months ago
veypi 5460289957 refactor(ui): Update vbase.js to match new Scoped RBAC permission system
- Replace old permission check methods with new Perm/PermCreate/PermRead/PermWrite/PermAdmin
    - Add Level constants export (None, Create, Read, Write, ReadWrite, Admin)
    - Remove role-based permission checks (hasRole, checkPermAny, checkPermAll)
    - Update core permission checking logic to match backend checkPermissionLevel
    - Remove _isAdmin helper, use Level.Admin check instead
    - Simplify localStorage keys (remove scope prefix from keys)
    - Clean up console.log in env.js
3 months ago
veypi df0f7f047a refactor: Rename Config to Global and simplify app initialization
- Rename cfg.Config to cfg.Global for consistency
    - Simplify cli/main.go to use vbase.App.Run() pattern
    - Update init.go to create app with vigo.New and Init function
    - Update all references from cfg.Config to cfg.Global across api, libs, models, and tests
    - Fix VBase constructor parameter order in ui/vbase.js
    - Update ui/env.js to use new VBase('vb', '/') initialization
4 months ago
veypi 4101daeed3 refactor: 重构用户/组织/OAuth页面UI 4 months ago
veypi 983a5651a3 fix: 修复路由和页面加载问题 4 months ago
veypi e5308f9471 feat: 全新UI框架升级和页面重构 4 months ago
veypi 5654a7cd37 remove old 4 months ago
veypi 271131a5e1 update ui 4 months ago
veypi 67b92662d1 add sms enable option 6 months ago
veypi 134ab38751 fix: fix login bug 10 months ago
veypi ada216cfd5 feat: change auth check 10 months ago
veypi 1a29442c1c im dead 11 months ago
veypi e83f2da265 update crud and env.js 11 months ago