2026-10-05 09:36:20 +02:00
# retoor <retoor@molodetz.nl>
from molodetz.docs_api.registry import endpoint , field
GROUP = {
"slug" : "account" ,
"title" : "Account" ,
2026-10-05 11:25:41 +02:00
"description" : "Session login, API key, notifications. No JWT, no OAuth." ,
2026-10-05 09:36:20 +02:00
"endpoints" : [
2026-10-05 11:25:41 +02:00
endpoint ( "GET" , "/auth/login" , "Login page" , sample = { "errors" : [], "next" : "/admin" }),
2026-10-05 09:36:20 +02:00
endpoint (
"POST" ,
"/auth/login" ,
2026-10-05 11:25:41 +02:00
"Log in" ,
"Sets an httponly session cookie (7 days, 30 with remember me)." ,
2026-10-05 09:36:20 +02:00
fields = [ field ( "username" , required = True , example = "{{username}}" ), field ( "password" , required = True , type = "password" ), field ( "remember" , type = "boolean" )],
sample = { "ok" : True , "redirect" : "/admin" , "data" : None },
interactive = False ,
),
2026-10-05 11:25:41 +02:00
endpoint ( "POST" , "/auth/logout" , "Log out" , sample = { "ok" : True , "redirect" : "/" , "data" : None }, interactive = False ),
endpoint ( "GET" , "/profile/api-key" , "View API key" , auth = "member" , sample = { "api_key" : "{{api_key}}" }),
endpoint ( "POST" , "/profile/api-key/regenerate" , "Renew API key" , auth = "member" , destructive = True , sample = { "ok" : True , "redirect" : "/profile/api-key" , "data" : { "api_key" : "..." }}, interactive = False ),
endpoint ( "POST" , "/profile/avatar/regenerate" , "Renew avatar" , auth = "member" , destructive = True , sample = { "ok" : True }, interactive = False ),
endpoint ( "GET" , "/notifications" , "Notifications" , auth = "member" , sample = { "notifications" : [], "unread" : 0 }),
endpoint ( "POST" , "/notifications/read" , "Mark all read" , auth = "member" , sample = { "ok" : True , "redirect" : "/notifications" }),
endpoint ( "GET" , "/terms" , "Terms" , sample = { "title" : "Terms" }),
endpoint ( "POST" , "/terms/accept" , "Accept terms" , auth = "member" , sample = { "ok" : True , "redirect" : "/" }),
2026-10-05 09:36:20 +02:00
endpoint ( "GET" , "/privacy" , "Privacy" , sample = { "title" : "Privacy" }),
],
}