auth
This commit is contained in:
parent
4573048a47
commit
d4a1492d56
16 changed files with 463 additions and 98 deletions
22
src/App.tsx
22
src/App.tsx
|
@ -1,16 +1,21 @@
|
|||
import { BrowserRouter, Route, Routes } from 'react-router'
|
||||
import HomePage from './pages/HomePage.tsx'
|
||||
import HomePage from './feed/HomePage.tsx'
|
||||
import { PostsService } from './feed/models/posts/postsService.ts'
|
||||
import AuthorPage from './pages/AuthorPage.tsx'
|
||||
import AuthorPage from './feed/AuthorPage.tsx'
|
||||
import { MediaService } from './model/media/mediaService.ts'
|
||||
import SignupPage from './pages/SignupPage.tsx'
|
||||
import LoginPage from './pages/LoginPage.tsx'
|
||||
import SignupPage from './auth/SignupPage.tsx'
|
||||
import LoginPage from './auth/LoginPage.tsx'
|
||||
import { AuthService } from './auth/authService.ts'
|
||||
import { useUser } from './store/userStore.ts'
|
||||
import LogoutPage from './auth/LogoutPage.tsx'
|
||||
import { ApiImpl } from './api/api.ts'
|
||||
|
||||
function App() {
|
||||
const postService = new PostsService()
|
||||
const mediaService = new MediaService()
|
||||
const authService = new AuthService()
|
||||
const [user] = useUser()
|
||||
const api = new ApiImpl()
|
||||
const postService = new PostsService(api)
|
||||
const mediaService = new MediaService(api)
|
||||
const authService = new AuthService(api, user)
|
||||
|
||||
return (
|
||||
<BrowserRouter>
|
||||
|
@ -21,7 +26,8 @@ function App() {
|
|||
/>
|
||||
<Route path="/u/:username" element={<AuthorPage postsService={postService} />} />
|
||||
<Route path="/login" element={<LoginPage authService={authService} />} />
|
||||
<Route path="/signup/:code?" element={<SignupPage />} />
|
||||
<Route path="/logout" element={<LogoutPage authService={authService} />} />
|
||||
<Route path="/signup/:code?" element={<SignupPage authService={authService} />} />
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue