c23145f3389d7953c2a2d73f5d30d2740b7753ad
## Summary
Refactored the authentication flow to correctly separate traffic between the
Auth service and Blog service. Added post-registration author creation and
switched all `/auth/*` calls to the dedicated `auth` Axios client.
## Changes
### AuthProvider
- Replaced `api.post('/auth/register')` with `auth.post('/register')`
- Replaced `api.post('/auth/login')` with `auth.post('/login')`
- Added automatic author creation after user registration (`POST /authors`)
- Switched user identity lookup from `api.get('/auth/me')` to `auth.get('/me')`
- Replaced `/authors/{id}` lookup with `/authors/me`
- Updated imports to use `{ api, auth }`
### Axios Client Layer
- Introduced a new `auth` Axios instance using `VITE_AUTH_BASE_URL`
- Added shared token attachment and 401 handling logic
- Applied interceptors to both `auth` and `api` clients
- Removed inline auth logic from `api.ts`
### Types
- Added `VITE_AUTH_BASE_URL` to `vite-env.d.ts`
## Impact
- Correctly routes authentication traffic to the Auth microservice
- Ensures an Author document is created automatically after registration
- Simplifies identity loading via `/authors/me`
- Improves token handling consistency across both services
Material UI - React Router example in TypeScript
How to use
Download the example or clone the repo:
curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/material-ui-react-router-ts
cd material-ui-react-router-ts
Install it and run:
npm install
npm run dev
or:
The idea behind the example
This example demonstrates how you can use Material UI with React Router in TypeScript.
It includes @mui/material and its peer dependencies, including Emotion, the default style engine in Material UI.
What's next?
You now have a working example project. You can head back to the documentation and continue by browsing the templates section.
Description
Languages
TypeScript
98.4%
JavaScript
0.6%
Dockerfile
0.5%
HTML
0.5%