Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/mcs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/minio/cli"
)

// Help template for m3.
// Help template for mcs.
var mcsHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}

Expand All @@ -57,10 +57,10 @@ var appCmds = []cli.Command{
}

func newApp(name string) *cli.App {
// Collection of m3 commands currently supported are.
// Collection of mcs commands currently supported are.
var commands []cli.Command

// Collection of m3 commands currently supported in a trie tree.
// Collection of mcs commands currently supported in a trie tree.
commandsTree := trie.NewTrie()

// registerCommand registers a cli command.
Expand Down
2 changes: 1 addition & 1 deletion portal-ui/src/common/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class API {
storage.removeItem("token");
window.location.href = "/";
}
this.onError(err);
return this.onError(err);
});
}

Expand Down
18 changes: 15 additions & 3 deletions portal-ui/src/screens/Console/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
} from "../../icons";
import { createStyles, Theme } from "@material-ui/core/styles";
import PersonIcon from "@material-ui/icons/Person";
import api from "../../common/api";

const styles = (theme: Theme) =>
createStyles({
Expand Down Expand Up @@ -91,9 +92,20 @@ interface MenuProps {

class Menu extends React.Component<MenuProps> {
logout() {
storage.removeItem("token");
this.props.userLoggedIn(false);
history.push("/");
const deleteSession = () => {
storage.removeItem("token");
this.props.userLoggedIn(false);
history.push("/");
}
api
.invoke("POST", `/api/v1/logout`)
.then(() => {
deleteSession();
})
.catch((err: any) => {
console.log(err);
deleteSession();
});
}

render() {
Expand Down
2 changes: 2 additions & 0 deletions restapi/configure_mcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func configureAPI(api *operations.McsAPI) http.Handler {

// Register login handlers
registerLoginHandlers(api)
// Register logout handlers
registerLogoutHandlers(api)
// Register bucket handlers
registerBucketsHandlers(api)
// Register all users handlers
Expand Down
40 changes: 40 additions & 0 deletions restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions restapi/operations/mcs_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions restapi/operations/user_api/logout.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions restapi/operations/user_api/logout_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading