feat: add auth status endpoint
This commit is contained in:
parent
30ad92fb8d
commit
1dd4fa22cd
|
@ -3,6 +3,7 @@ package controller
|
|||
import (
|
||||
"git.lumeweb.com/LumeWeb/portal/controller/request"
|
||||
"git.lumeweb.com/LumeWeb/portal/controller/response"
|
||||
"git.lumeweb.com/LumeWeb/portal/middleware"
|
||||
"git.lumeweb.com/LumeWeb/portal/service/auth"
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
@ -99,3 +100,13 @@ func (a *AuthController) PostLogout() {
|
|||
// Return a success response to the client.
|
||||
a.Ctx.StatusCode(iris.StatusNoContent)
|
||||
}
|
||||
|
||||
func (a *AuthController) GetStatus() {
|
||||
middleware.VerifyJwt(a.Ctx)
|
||||
|
||||
if a.Ctx.IsStopped() {
|
||||
return
|
||||
}
|
||||
|
||||
a.respondJSON(&response.AuthStatusResponse{Status: true})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package response
|
||||
|
||||
type AuthStatusResponse struct {
|
||||
Status bool `json:"status"`
|
||||
}
|
Loading…
Reference in New Issue