Logo
Explore Help
Register Sign In
poignatov/play-life
1
0
Fork 0
You've already forked play-life
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
28d8148665b6f4071cd782ad829fc117c12a0284
play-life/play-life-web/src/components/auth/AuthScreen.jsx

17 lines
416 B
React
Raw Normal View History

v2.0.0: Multi-user authentication with JWT Features: - User registration and login with JWT tokens - All data is now user-specific (multi-tenancy) - Profile page with integrations and logout - Automatic migration of existing data to first user Backend changes: - Added users and refresh_tokens tables - Added user_id to all data tables (projects, entries, nodes, dictionaries, words, progress, configs, telegram_integrations, weekly_goals) - JWT authentication middleware - claimOrphanedData() for data migration Frontend changes: - AuthContext for state management - Login/Register forms - Profile page (replaced Integrations) - All API calls use authFetch with Bearer token Migration notes: - On first deploy, backend automatically adds user_id columns - First user to login claims all existing data
2026-01-01 18:21:18 +03:00
import React, { useState } from 'react'
import LoginForm from './LoginForm'
import RegisterForm from './RegisterForm'
function AuthScreen() {
const [mode, setMode] = useState('login') // 'login' or 'register'
if (mode === 'register') {
return <RegisterForm onSwitchToLogin={() => setMode('login')} />
}
return <LoginForm onSwitchToRegister={() => setMode('register')} />
}
export default AuthScreen
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 46ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API