refactor: put some account endpoints under account instead of auth
This commit is contained in:
parent
4391e9fc31
commit
fddc64799e
|
@ -390,13 +390,14 @@ func (a *AccountAPI) Routes() (*httprouter.Router, error) {
|
|||
"POST /api/auth/ping": middleware.ApplyMiddlewares(a.ping, corsMw.Handler, pingAuthMw, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/login": middleware.ApplyMiddlewares(a.login, corsMw.Handler, loginAuthMw2fa, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/register": middleware.ApplyMiddlewares(a.register, corsMw.Handler, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/verify-email": middleware.ApplyMiddlewares(a.verifyEmail, corsMw.Handler, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/otp/verify": middleware.ApplyMiddlewares(a.otpVerify, corsMw.Handler, authMw, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/otp/validate": middleware.ApplyMiddlewares(a.otpValidate, corsMw.Handler, authMw, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/otp/disable": middleware.ApplyMiddlewares(a.otpDisable, corsMw.Handler, authMw, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/password-reset/request": middleware.ApplyMiddlewares(a.passwordResetRequest, corsMw.Handler, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/password-reset/confirm": middleware.ApplyMiddlewares(a.passwordResetConfirm, corsMw.Handler, middleware.ProxyMiddleware),
|
||||
"POST /api/auth/logout": middleware.ApplyMiddlewares(a.logout, corsMw.Handler, authMw, middleware.ProxyMiddleware),
|
||||
|
||||
"POST /api/account/verify-email": middleware.ApplyMiddlewares(a.verifyEmail, corsMw.Handler, middleware.ProxyMiddleware),
|
||||
"POST /api/account/otp/verify": middleware.ApplyMiddlewares(a.otpVerify, corsMw.Handler, authMw, middleware.ProxyMiddleware),
|
||||
"POST /api/account/otp/disable": middleware.ApplyMiddlewares(a.otpDisable, corsMw.Handler, authMw, middleware.ProxyMiddleware),
|
||||
"POST /api/account/password-reset/request": middleware.ApplyMiddlewares(a.passwordResetRequest, corsMw.Handler, middleware.ProxyMiddleware),
|
||||
"POST /api/account/password-reset/confirm": middleware.ApplyMiddlewares(a.passwordResetConfirm, corsMw.Handler, middleware.ProxyMiddleware),
|
||||
"GET /*path": middleware.ApplyMiddlewares(getHandler, corsMw.Handler),
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ paths:
|
|||
description: Successfully registered
|
||||
'400':
|
||||
description: Bad Request
|
||||
/api/auth/verify-email:
|
||||
/api/account/verify-email:
|
||||
post:
|
||||
summary: Verify email address
|
||||
requestBody:
|
||||
|
@ -64,7 +64,7 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/OTPGenerateResponse'
|
||||
/api/auth/otp/verify:
|
||||
/api/account/otp/verify:
|
||||
post:
|
||||
summary: Verify OTP for enabling two-factor authentication
|
||||
requestBody:
|
||||
|
@ -76,7 +76,7 @@ paths:
|
|||
responses:
|
||||
'200':
|
||||
description: OTP verified successfully
|
||||
/api/auth/otp/validate:
|
||||
/api/account/otp/validate:
|
||||
post:
|
||||
summary: Validate OTP for two-factor authentication login
|
||||
requestBody:
|
||||
|
@ -100,7 +100,7 @@ paths:
|
|||
responses:
|
||||
'200':
|
||||
description: OTP disabled successfully
|
||||
/api/auth/password-reset/request:
|
||||
/api/password-rese/password-reset/request:
|
||||
post:
|
||||
summary: Request a password reset
|
||||
requestBody:
|
||||
|
@ -112,7 +112,7 @@ paths:
|
|||
responses:
|
||||
'200':
|
||||
description: Password reset requested successfully
|
||||
/api/auth/password-reset/confirm:
|
||||
/api/password-rese/password-reset/confirm:
|
||||
post:
|
||||
summary: Confirm a password reset
|
||||
requestBody:
|
||||
|
|
Loading…
Reference in New Issue