Fix 200 response exception builder
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -113,5 +113,12 @@ func Exchange(c *gin.Context) {
|
||||
RedirectUri string `json:"redirect_uri"`
|
||||
}{url.String()}
|
||||
|
||||
utils.HttpResponse(c, 200, "", "success", exchangeResp)
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusSuccess).
|
||||
SetService(exception.ServiceAuth).
|
||||
SetEndpoint(exception.EndpointAuthServiceExchange).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonSuccess).
|
||||
Build()
|
||||
utils.HttpResponse(c, 200, errorCode, exchangeResp)
|
||||
}
|
||||
|
||||
@@ -118,5 +118,12 @@ func Magic(c *gin.Context) {
|
||||
)
|
||||
}
|
||||
|
||||
utils.HttpResponse(c, 200, "", "magic link sent")
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusServer).
|
||||
SetService(exception.ServiceAuth).
|
||||
SetEndpoint(exception.EndpointAuthServiceMagic).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonSuccess).
|
||||
Build()
|
||||
utils.HttpResponse(c, 200, errorCode)
|
||||
}
|
||||
|
||||
@@ -64,5 +64,12 @@ func Refresh(c *gin.Context) {
|
||||
RefreshToken string `json:"refresh_token"`
|
||||
}{accessToken, refreshToken}
|
||||
|
||||
utils.HttpResponse(c, 200, "", "success", tokenResp)
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusServer).
|
||||
SetService(exception.ServiceAuth).
|
||||
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonSuccess).
|
||||
Build()
|
||||
utils.HttpResponse(c, 200, errorCode, tokenResp)
|
||||
}
|
||||
|
||||
@@ -83,5 +83,12 @@ func Token(c *gin.Context) {
|
||||
RefreshToken string `json:"refresh_token"`
|
||||
}{accessToken, refreshToken}
|
||||
|
||||
utils.HttpResponse(c, 200, "", "success", tokenResp)
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusServer).
|
||||
SetService(exception.ServiceAuth).
|
||||
SetEndpoint(exception.EndpointAuthServiceToken).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonSuccess).
|
||||
Build()
|
||||
utils.HttpResponse(c, 200, errorCode, tokenResp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user