mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-12 13:53:30 +00:00
TRA-4075 fix logout (#595)
This commit is contained in:
parent
2c4a5d06ab
commit
2110afc514
@ -18,7 +18,7 @@ func Login(c *gin.Context) {
|
|||||||
func Logout(c *gin.Context) {
|
func Logout(c *gin.Context) {
|
||||||
token := c.GetHeader("x-session-token")
|
token := c.GetHeader("x-session-token")
|
||||||
if err := providers.Logout(token, c.Request.Context()); err != nil {
|
if err := providers.Logout(token, c.Request.Context()); err != nil {
|
||||||
c.AbortWithStatusJSON(401, gin.H{"error": "error occured while logging out, the session might still be valid"})
|
c.AbortWithStatusJSON(500, gin.H{"error": "error occured while logging out, the session might still be valid"})
|
||||||
} else {
|
} else {
|
||||||
c.JSON(200, "")
|
c.JSON(200, "")
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ func AnyUserExists(ctx context.Context) (bool, error) {
|
|||||||
|
|
||||||
func Logout(token string, ctx context.Context) error {
|
func Logout(token string, ctx context.Context) error {
|
||||||
logoutRequest := client.V0alpha2Api.SubmitSelfServiceLogoutFlowWithoutBrowser(ctx)
|
logoutRequest := client.V0alpha2Api.SubmitSelfServiceLogoutFlowWithoutBrowser(ctx)
|
||||||
logoutRequest.SubmitSelfServiceLogoutFlowWithoutBrowserBody(ory.SubmitSelfServiceLogoutFlowWithoutBrowserBody{
|
logoutRequest = logoutRequest.SubmitSelfServiceLogoutFlowWithoutBrowserBody(ory.SubmitSelfServiceLogoutFlowWithoutBrowserBody{
|
||||||
SessionToken: token,
|
SessionToken: token,
|
||||||
})
|
})
|
||||||
if response, err := logoutRequest.Execute(); err != nil {
|
if response, err := logoutRequest.Execute(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user