22 lines
587 B
Go
22 lines
587 B
Go
package token
|
|
|
|
import (
|
|
"net/http"
|
|
"schisandra-album-cloud-microservices/common/xhttp"
|
|
|
|
"schisandra-album-cloud-microservices/app/auth/api/internal/logic/token"
|
|
"schisandra-album-cloud-microservices/app/auth/api/internal/svc"
|
|
)
|
|
|
|
func RefreshTokenHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
l := token.NewRefreshTokenLogic(r.Context(), svcCtx)
|
|
resp, err := l.RefreshToken(r)
|
|
if err != nil {
|
|
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
|
|
} else {
|
|
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
|
|
}
|
|
}
|
|
}
|