Skip to content

Commit

Permalink
login fix
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Dec 18, 2024
1 parent af15bcb commit 85efc50
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 20 deletions.
6 changes: 6 additions & 0 deletions MythicReactUI/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.67] - 2024-12-18

### Changed

- Fixed a login bug after adding additional context to tracked local user state

## [0.2.66] - 2024-12-17

### Changed
Expand Down
1 change: 1 addition & 0 deletions MythicReactUI/src/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const successfulLogin = (data) => {
me.server_skew = difference;
meState({
loggedIn: true,
...data,
...me,
server_skew: difference
});
Expand Down
14 changes: 5 additions & 9 deletions MythicReactUI/src/components/pages/Login/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export function LoginForm(props){
//console.log(data)
if("access_token" in data){
successfulLogin(data);
restartWebsockets();
}else{
snackActions.warning("Invalid Username or Password");
console.log("Error", data);
Expand Down Expand Up @@ -184,12 +183,10 @@ export function LoginForm(props){
};
return (
<div style={{justifyContent: "center", display: "flex"}}>
{
me.loggedIn ?
(
<Navigate replace to={redirectPath}/>
)
: (
{
me.loggedIn && (<Navigate replace to={redirectPath}/>)
}

<div style={{backgroundColor: "transparent"}}>
<CardContent >
<img src={logo} height="400px" alt="Mythic logo"/>
Expand Down Expand Up @@ -256,8 +253,7 @@ export function LoginForm(props){
}
</CardContent>
</div>
)
}

</div>
)
}
Expand Down
3 changes: 2 additions & 1 deletion MythicReactUI/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {snackActions} from './components/utilities/Snackbar';
import jwt_decode from 'jwt-decode';
import {meState} from './cache';

export const mythicUIVersion = "0.2.66";
export const mythicUIVersion = "0.2.67";

let fetchingNewToken = false;

Expand Down Expand Up @@ -328,6 +328,7 @@ export function restartWebsockets () {
if(localStorage.getItem("access_token") !== null){
if(isJWTValid(localStorage.getItem("access_token"))){
if(localStorage.getItem("user") !== null){
console.log("loading meState from localStorage")
meState({
loggedIn: true,
access_token: localStorage.getItem("access_token"),
Expand Down
2 changes: 1 addition & 1 deletion Mythic_CLI/src/cmd/manager/dockerComposeManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (d *DockerComposeManager) CheckRequiredManagerVersion() bool {
log.Printf("[-] Failed to get docker compose: %v\n", err)
return false
}
if strings.Contains(composeCheckString, "Docker Compose version v") {
if strings.Contains(composeCheckString, "Docker Compose version ") {
return true
}
log.Printf("[-] Unable to find compose plugin. Please install the docker compose plugin.\n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func AgentMessageWebhook(c *gin.Context) {
errorMessage := "Error! Failed to process agent message. Check the following details for more information about the request:\nConnection to: "
errorMessage += fmt.Sprintf("%s via HTTP %s\nFrom: %s\nUser-Agent: %s\n%v\n", requestUrl, c.Request.Method, requestIp, requestUserAgent, err)
go rabbitmq.SendAllOperationsMessage(errorMessage, 0, "agent_message_bad_message", database.MESSAGE_LEVEL_WARNING)
logging.LogError(err, "Failed to process agent message in body of get request", "errorMsg", errorMessage)
logging.LogError(err, "Failed to process agent message in body of post request", "errorMsg", errorMessage)
c.Status(http.StatusNotFound)
return
}
Expand Down
6 changes: 3 additions & 3 deletions mythic-react-docker/mythic/public/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "/new/static/css/main.602591e6.css",
"main.js": "/new/static/js/main.ec3c5064.js",
"main.js": "/new/static/js/main.a5c08a27.js",
"static/media/mythic-red.png": "/new/static/media/mythic-red.203468a4e5240d239aa0.png",
"static/media/mythic_red_small.svg": "/new/static/media/mythic_red_small.793b41cc7135cdede246661ec232976b.svg",
"index.html": "/new/index.html",
"main.602591e6.css.map": "/new/static/css/main.602591e6.css.map",
"main.ec3c5064.js.map": "/new/static/js/main.ec3c5064.js.map"
"main.a5c08a27.js.map": "/new/static/js/main.a5c08a27.js.map"
},
"entrypoints": [
"static/css/main.602591e6.css",
"static/js/main.ec3c5064.js"
"static/js/main.a5c08a27.js"
]
}
2 changes: 1 addition & 1 deletion mythic-react-docker/mythic/public/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/new/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" href="/new/logo192.png"/><link rel="manifest" href="/new/manifest.json"/><title>Mythic</title><script defer="defer" src="/new/static/js/main.ec3c5064.js"></script><link href="/new/static/css/main.602591e6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/new/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" href="/new/logo192.png"/><link rel="manifest" href="/new/manifest.json"/><title>Mythic</title><script defer="defer" src="/new/static/js/main.a5c08a27.js"></script><link href="/new/static/css/main.602591e6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 85efc50

Please sign in to comment.