@@ -141,6 +141,11 @@ export const openapi = {
141141 role : { type : 'string' , enum : [ 'user' , 'admin' ] } ,
142142 status : { type : 'string' , enum : [ 'active' , 'suspended' ] } ,
143143 statusReason : { type : 'string' } ,
144+ consent : {
145+ type : 'object' ,
146+ description : 'When the contributor accepted the consent notice (null until they do).' ,
147+ properties : { acceptedAt : { type : 'string' , format : 'date-time' , nullable : true } , version : { type : 'string' , nullable : true } } ,
148+ } ,
144149 connections : {
145150 type : 'object' ,
146151 properties : {
@@ -254,6 +259,7 @@ export const openapi = {
254259 mirrored : { type : 'boolean' } ,
255260 duration : { type : 'number' } ,
256261 submittedAt : { type : 'string' , format : 'date-time' } ,
262+ cooldownStartedAt : { type : 'string' , format : 'date-time' , description : 'When the server accepted the upload for processing and claimed the per-video cooldown.' } ,
257263 size : { type : 'integer' } ,
258264 mimeType : { type : 'string' , enum : [ 'video/mp4' , 'video/webm' , 'video/quicktime' ] } ,
259265 archivePath : { type : 'string' , nullable : true , description : 'Included for admins only.' } ,
@@ -347,9 +353,27 @@ export const openapi = {
347353 '/auth/verify-email' : {
348354 post : {
349355 tags : [ 'Auth' ] ,
350- summary : 'Verify an email code and establish a session' ,
356+ summary : 'Verify an email code' ,
357+ description : 'A valid code does not create the account or log anyone in. It returns a short-lived consentToken to use with POST /auth/consent.' ,
351358 requestBody : { required : true , content : { 'application/json' : { schema : ref ( 'VerifyEmailInput' ) } } } ,
352- responses : { 200 : jsonResponse ( 'Verified and logged in' , ref ( 'User' ) ) , ...authErrors } ,
359+ responses : { 200 : jsonResponse ( 'Code accepted' , { type : 'object' , properties : { consentToken : { type : 'string' } } } ) , ...authErrors } ,
360+ } ,
361+ } ,
362+ '/auth/consent' : {
363+ post : {
364+ tags : [ 'Auth' ] ,
365+ summary : 'Accept the consent notice, create the account and log in' ,
366+ description : 'Activates the account, stores the acceptance date, time and notice version, and sets the session cookie.' ,
367+ requestBody : { required : true , content : { 'application/json' : { schema : { type : 'object' , required : [ 'consentToken' , 'accepted' , 'version' ] , properties : { consentToken : { type : 'string' } , accepted : { type : 'boolean' , enum : [ true ] } , version : { type : 'string' } } } } } } ,
368+ responses : { 200 : jsonResponse ( 'Account created and logged in' , ref ( 'User' ) ) , ...authErrors , 409 : errorResponse } ,
369+ } ,
370+ } ,
371+ '/auth/decline-consent' : {
372+ post : {
373+ tags : [ 'Auth' ] ,
374+ summary : 'Decline the consent notice and discard the unfinished sign-up' ,
375+ requestBody : { required : true , content : { 'application/json' : { schema : { type : 'object' , required : [ 'consentToken' ] , properties : { consentToken : { type : 'string' } } } } } } ,
376+ responses : { 204 : { description : 'Sign-up discarded' } , ...authErrors } ,
353377 } ,
354378 } ,
355379 '/auth/resend-verification' : {
@@ -402,6 +426,16 @@ export const openapi = {
402426 responses : { 200 : jsonResponse ( 'Updated user' , ref ( 'User' ) ) , 401 : errorResponse , 422 : errorResponse } ,
403427 } ,
404428 } ,
429+ '/users/me/consent' : {
430+ post : {
431+ tags : [ 'Users' ] ,
432+ summary : 'Accept the consent notice' ,
433+ description : 'Records the acceptance date and time and the notice version. Submissions are refused with CONSENT_REQUIRED until this is done.' ,
434+ security : userSecurity ,
435+ requestBody : { required : true , content : { 'application/json' : { schema : { type : 'object' , required : [ 'accepted' , 'version' ] , properties : { accepted : { type : 'boolean' , enum : [ true ] } , version : { type : 'string' } } } } } } ,
436+ responses : { 200 : jsonResponse ( 'Updated user' , ref ( 'User' ) ) , 401 : errorResponse , 409 : errorResponse , 422 : errorResponse } ,
437+ } ,
438+ } ,
405439 '/categories' : {
406440 get : {
407441 tags : [ 'Categories' ] ,
0 commit comments