Files
nextgo/Login_Register.md
Beyhan Oğur 9eb7aea821 first commit
2026-04-26 22:15:25 +03:00

260 lines
8.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices...
Login
curl -X 'POST' \
'http://localhost:8080/api/v1/auth/login' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"email": "beyhan@beyhan.dev",
"password": "1923btO**"
}'
Request URL
http://localhost:8080/api/v1/auth/login
Server response
Code Details
200
Response body
Download
{
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwidXNlcl9pZCI6IjEiLCJlbWFpbCI6ImJleWhhbkBiZXloYW4uZGV2IiwidXNlcm5hbWUiOiJiZXloYW5vIiwiZXhwIjoxNzc2MjY2MDM2LCJpYXQiOjE3NzYyNjUxMzYsImp0aSI6IjQwN2ZhNmM2YjQwZjY3NTk5ODQ5YWYwNGM1ZjNkNzJiIn0.ie-4br4q5E8z24c4Zxj1pRp0XTudhKpv2nl1C-UJ-Z0",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsInVzZXJfaWQiOiIxIiwiZXhwIjoxNzc2ODY5OTM2LCJpYXQiOjE3NzYyNjUxMzYsImp0aSI6IjZmNDlhZmE4ZmZmYjMxNjdmZTI3NDkyZDhhYjcyMWEyIn0.YJVnaE2ahOQgbOrkxCY2eyLn2W6upm6VQ9XmCmgROSk"
}
Response headers
access-control-allow-headers: Authorization,Content-Type
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
access-control-allow-origin: *
content-length: 554
content-type: application/json; charset=utf-8
date: Wed,15 Apr 2026 14:58:56 GMT
x-ratelimit-limit: 120
x-ratelimit-remaining: 119
x-ratelimit-reset: 59
Register
curl -X 'POST' \
'http://localhost:8080/api/v1/auth/register' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"confirm_password": "1923btO**",
"email": "aaaaa@ffff.com",
"first_name": "Ahmet",
"last_name": "Arfi",
"password": "1923btO**",
"username": "aaaaa@ffff.com"
}'
Request URL
http://localhost:8080/api/v1/auth/register
Server response
Code Details
201
Response body
Download
{
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwidXNlcl9pZCI6IjMiLCJlbWFpbCI6ImFhYWFhQGZmZmYuY29tIiwidXNlcm5hbWUiOiJhYWFhYUBmZmZmLmNvbSIsImV4cCI6MTc3NjI2NjE5MCwiaWF0IjoxNzc2MjY1MjkwLCJqdGkiOiIwNDc0NzllMTU5MDk1OGFlYTFhMzYyM2ZlOGRmNjY3MiJ9.v_bfsKeDjyIvo-g91zIjaV0tpbU8caSOlK_VR6p5mC8",
"message": "kayit basarili",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsInVzZXJfaWQiOiIzIiwiZXhwIjoxNzc2ODcwMDkwLCJpYXQiOjE3NzYyNjUyOTAsImp0aSI6ImE3MDA2ZjdlNmE5NmFlMWQzMzdlMzk1ODZmODM4N2EwIn0.F0IQn_Ocg0D8CCXwxfBTo60jQGVv80WfhhGRz5eIj_I"
}
Response headers
access-control-allow-headers: Authorization,Content-Type
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
access-control-allow-origin: *
content-length: 586
content-type: application/json; charset=utf-8
date: Wed,15 Apr 2026 15:01:30 GMT
x-ratelimit-limit: 120
x-ratelimit-remaining: 119
x-ratelimit-reset: 59
refresh token
curl -X 'POST' \
'http://localhost:8080/api/v1/auth/refresh' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsInVzZXJfaWQiOiIxIiwiZXhwIjoxNzc2ODY5OTM2LCJpYXQiOjE3NzYyNjUxMzYsImp0aSI6IjZmNDlhZmE4ZmZmYjMxNjdmZTI3NDkyZDhhYjcyMWEyIn0.YJVnaE2ahOQgbOrkxCY2eyLn2W6upm6VQ9XmCmgROSk"
}'
Request URL
http://localhost:8080/api/v1/auth/refresh
Server response
Code Details
200
Response body
Download
{
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwidXNlcl9pZCI6IjEiLCJlbWFpbCI6ImJleWhhbkBiZXloYW4uZGV2IiwidXNlcm5hbWUiOiJiZXloYW5vIiwiZXhwIjoxNzc2MjY2MDU2LCJpYXQiOjE3NzYyNjUxNTYsImp0aSI6Ijc4N2QzMzY2MjA5OWQ0ZDcxNTc4ZWVlMDYzMmYwNmM3In0.sqHvycsxQ_yPbq4VvsW6hKt-r72sq-ZvK03b_YisaLc",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsInVzZXJfaWQiOiIxIiwiZXhwIjoxNzc2ODY5OTU2LCJpYXQiOjE3NzYyNjUxNTYsImp0aSI6IjQ2NmMwMDI4NmM5NDg2ZWMzNmExMjYxMjI4NWMxNTNmIn0.Sq3IVBYaJ94kjnR9DmSzELxOEFrWZ3gFYhUyuQtXtGg"
}
Response headers
access-control-allow-headers: Authorization,Content-Type
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
access-control-allow-origin: *
content-length: 554
content-type: application/json; charset=utf-8
date: Wed,15 Apr 2026 14:59:16 GMT
x-ratelimit-limit: 120
x-ratelimit-remaining: 118
x-ratelimit-reset: 40
Me
curl -X 'GET' \
'http://localhost:8080/api/v1/me' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwidXNlcl9pZCI6IjEiLCJlbWFpbCI6ImJleWhhbkBiZXloYW4uZGV2IiwidXNlcm5hbWUiOiJiZXloYW5vIiwiZXhwIjoxNzc2MjY0MTEzLCJpYXQiOjE3NzYyNjMyMTMsImp0aSI6Ijk5ODZmYjMzYWFhMzc5ZDRhODA3NjVhZTg1MjMwODcxIn0.wvYGM57tE9tV1MVGsjJ-nK8GXbzRXbPNbYKFHjN2_Ic'
Request URL
http://localhost:8080/api/v1/me
Server response
Code Details
401
Error: Unauthorized
Response body
Download
{
"error": "token gecersiz"
}
Response headers
access-control-allow-headers: Authorization,Content-Type
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
access-control-allow-origin: *
content-length: 26
content-type: application/json; charset=utf-8
date: Wed,15 Apr 2026 15:01:40 GMT
x-ratelimit-limit: 120
x-ratelimit-remaining: 118
x-ratelimit-reset: 50
profile guncelle
curl -X 'PUT' \
'https://mcp.beyhano.net.tr/api/v1/me/profile' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwidXNlcl9pZCI6IjEiLCJlbWFpbCI6ImJleWhhbkBiZXloYW4uZGV2IiwidXNlcm5hbWUiOiJCZXloYW4gT8SfdXIiLCJleHAiOjE3NzYyOTgwNzAsImlhdCI6MTc3NjI5NzE3MCwianRpIjoiZGUyZWNiZGY5ZjU4MGJhOTA4ODI1MGUyMWE0MTNjYTcifQ.NiT5spcCm9sd7S9DttuFHA__KzFq3pQIJ8xkJKtntnc' \
-H 'Content-Type: multipart/form-data' \
-F 'first_name=Beyhan' \
-F 'last_name=Ogıur' \
-F 'avatar=@f1f1db3e1b9396ad23d09fc92cee87ce.png;type=image/png'
Request URL
https://mcp.beyhano.net.tr/api/v1/me/profile
Server response
Code Details
200
Response body
Download
{
"user_id": 1,
"first_name": "Beyhan",
"last_name": "Ogıur",
"avatar_url": "/uploads/avatars/avatar_1776297238_5de7733ccb7677b5.png"
}
Response headers
access-control-allow-headers: Authorization,Content-Type
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
access-control-allow-origin: *
alt-svc: h3=":443"; ma=86400
cf-cache-status: DYNAMIC
cf-ray: 9ecedf6b8c08d0ef-SOF
content-encoding: zstd
content-type: application/json; charset=utf-8
date: Wed,15 Apr 2026 23:53:58 GMT
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
priority: u=0,i=?0
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=bVAVFdOIo1q%2FsyLOzVfAgAMNtbfs6PGgP%2BJFFLY91j1HIEuBzU5Y51M7%2B3l90JcY9UxPMfxrrdbid%2FEiX326Y5PgU06xedtMasI6GppTIki8nzm7zzCpAZH9IMqaubLWz9bo1bA%3D"}]}
server: cloudflare
server-timing: cfExtPri
x-firefox-http3: h3
x-ratelimit-limit: 120
x-ratelimit-remaining: 119
x-ratelimit-reset: 59
profile getir
Next uygulaması `GET {API_BASE_URL}/api/v1/me/profile` ile aynı JSONu kullanır; `avatar_url` göreliyse (`/uploads/...`) arayüzde `API_BASE_URL` ile birleştirilir.
curl -X 'GET' \
'https://mcp.beyhano.net.tr/api/v1/me/profile' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwidXNlcl9pZCI6IjEiLCJlbWFpbCI6ImJleWhhbkBiZXloYW4uZGV2IiwidXNlcm5hbWUiOiJCZXloYW4gT8SfdXIiLCJleHAiOjE3NzYyOTgwNzAsImlhdCI6MTc3NjI5NzE3MCwianRpIjoiZGUyZWNiZGY5ZjU4MGJhOTA4ODI1MGUyMWE0MTNjYTcifQ.NiT5spcCm9sd7S9DttuFHA__KzFq3pQIJ8xkJKtntnc'
Request URL
https://mcp.beyhano.net.tr/api/v1/me/profile
Server response
Code Details
200
Response body
Download
{
"user_id": 1,
"first_name": "Beyhan",
"last_name": "Ogıur",
"avatar_url": "/uploads/avatars/avatar_1776297372_406c31031e305f17.avif"
}
Response headers
access-control-allow-headers: Authorization,Content-Type
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
access-control-allow-origin: *
alt-svc: h3=":443"; ma=86400
cf-cache-status: DYNAMIC
cf-ray: 9ecee49cffdbd100-SOF
content-encoding: zstd
content-type: application/json; charset=utf-8
date: Wed,15 Apr 2026 23:57:31 GMT
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
priority: u=0,i=?0
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=mJkvoje74AtnDa8%2Fk5bOvG8MyrM0geb%2FxNuSkRs3ee4lJb54eajtsm5QPIiPV2vGal6M%2FNL5tRTq7o87oZp81yGy7k4Xxro4J6wsVbEXDULczObm4sUgvl%2FtSwlSnGDkVlnIyMw%3D"}]}
server: cloudflare
server-timing: cfExtPri
x-firefox-http3: h3
x-ratelimit-limit: 120
x-ratelimit-remaining: 119
x-ratelimit-reset: 59
<!-- END:nextjs-agent-rules -->