TMS Auth is an authentication library for React/UMI applications, version 1.3.13. It provides hooks and components for handling authentication flows such as login, logout, and permission checks. Built specifically for UMI framework with seamless integration. It ships TypeScript definitions. Last update was several months ago; no known recent active development. Alternative: umi-plugin-auth for UMI-specific setups or generic react-auth-kit.
npm install tms-authNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows minimal setup using AuthProvider and useAuth hook with a login button.
Set tokenKey explicitly in AuthProvider config to match your stored token key.
Replace withAuth with useAuth hook in functional components.
Ensure AuthProvider wraps the entire app or at least the components that need authentication.
Manually call cleanup logic after logout() if needed.
Wrap your component tree with <AuthProvider> at the top level.
Run 'npm install tms-auth' and ensure tsconfig includes 'node_modules' in typeRoots.
Check that AuthProvider is rendered and passes config correctly.
Provide a valid string for tokenKey in AuthProvider config.