@@ -30,7 +30,7 @@ export default defineNuxtConfig({
3030
3131## Authentication Flow
3232
33- Upon successful login via the ` /api/auth/login ` endpoint:
33+ Upon successful login via the ` /api/nuxt-users/session ` endpoint:
3434
35351 . ** User submits credentials** - Email and password are sent to the server
36362 . ** Password verification** - bcrypt compares the password with the stored hash
@@ -75,7 +75,7 @@ CREATE TABLE personal_access_tokens (
7575
7676### Endpoint
7777
78- ` POST /api/auth/login `
78+ ` POST /api/nuxt-users/session `
7979
8080### Request Body
8181
@@ -149,7 +149,7 @@ You can implement custom login logic:
149149<script setup>
150150const login = async (email, password) => {
151151 try {
152- const response = await $fetch('/api/auth/login ', {
152+ const response = await $fetch('/api/nuxt-users/session ', {
153153 method: 'POST',
154154 body: { email, password }
155155 })
@@ -256,9 +256,7 @@ You can also call the logout API directly:
256256<script setup>
257257const logout = async () => {
258258 try {
259- await $fetch('/api/auth/logout', {
260- method: 'GET'
261- })
259+ await $fetch('/api/nuxt-users/session', { method: 'DELETE' })
262260 console.log('Logged out successfully')
263261 } catch (error) {
264262 console.error('Logout failed:', error)
@@ -409,9 +407,9 @@ export default defineNuxtConfig({
409407 banDuration: 300000 , // 5 minute ban for violators
410408 delay: 1000 , // 1 second delay on banned IPs
411409 routes: [
412- ' /api/auth/login ' , // Protect login endpoint
413- ' /api/auth/forgot- password' , // Protect password reset requests
414- ' /api/auth/reset- password' // Protect password reset completion
410+ ' /api/nuxt-users/session ' , // Protect login endpoint
411+ ' /api/nuxt-users/ password/forgot ' , // Protect password reset requests
412+ ' /api/nuxt-users/ password/reset ' // Protect password reset completion
415413 ],
416414 log: true // Enable logging for monitoring
417415 }
@@ -432,12 +430,12 @@ For different security levels on different endpoints:
432430``` ts
433431apiShield : {
434432 routes : {
435- ' /api/auth/login ' : {
433+ ' /api/nuxt-users/session ' : {
436434 maxRequests: 5 , // Stricter limit for login
437435 duration: 60000 , // 1 minute
438436 banDuration: 600000 // 10 minute ban
439437 },
440- ' /api/auth/forgot- password' : {
438+ ' /api/nuxt-users/ password/forgot ' : {
441439 maxRequests: 3 , // Very strict for password reset
442440 duration: 300000 , // 5 minute window
443441 banDuration: 1800000 // 30 minute ban
0 commit comments