feat: add auth status endpoint

This commit is contained in:
Derrick Hammer 2023-06-15 01:26:36 -04:00
parent 30ad92fb8d
commit 1dd4fa22cd
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 16 additions and 0 deletions

View File

@ -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})
}

View File

@ -0,0 +1,5 @@
package response
type AuthStatusResponse struct {
Status bool `json:"status"`
}