Delete in memory session when user logout from mcs lint fixes Click logout button triggers logout request Clicking the actual logout button send the POST /logout request on mcs UI Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
22 lines
504 B
Go
22 lines
504 B
Go
package restapi
|
|
|
|
import (
|
|
"testing"
|
|
|
|
mcCmd "github.com/minio/mc/cmd"
|
|
"github.com/minio/mcs/restapi/sessions"
|
|
)
|
|
|
|
// TestLogout tests the case of deleting a valid session id
|
|
func TestLogout(t *testing.T) {
|
|
cfg := mcCmd.Config{}
|
|
// Creating a new session
|
|
sessionID := sessions.GetInstance().NewSession(&cfg)
|
|
// Test Case 1: Delete a session Valid sessionID
|
|
function := "logout()"
|
|
err := logout(sessionID)
|
|
if err != nil {
|
|
t.Errorf("Failed on %s:, error occurred: %s", function, err.Error())
|
|
}
|
|
}
|