Skip to content

Commit

Permalink
Stable Version 1.0.1 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Verox001 committed May 9, 2023
1 parent 03bb77a commit 38bc267
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.cimeyclust.ncpwebserver</groupId>
<artifactId>NCPWebserver</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<build>
<defaultGoal>clean package</defaultGoal>
<resources>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.cimeyclust.ncpwebserver</groupId>
<artifactId>NCPWebserver</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/com/cimeyclust/ncpwebserver/HttpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,13 @@ public Response serve(IHTTPSession session) {
break;

default:
if (!isAuthenticated(session)) {
code = 401;
responseBody = "{\"message\": \"Not authenticated!\"}";
break;
}
Response staticFileResponse = serveStaticFiles(session, new File(webapp.getPath()));
if (staticFileResponse != null) {
return staticFileResponse;
}
}

Response response = newFixedLengthResponse(Response.Status.lookup(code), "application/json", responseBody);
return response;
return newFixedLengthResponse(Response.Status.lookup(code), "application/json", responseBody);
}

private boolean isAuthenticated(IHTTPSession session) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cimeyclust/ncpwebserver/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onLoad() {
config = new Config(getDataFolder() + "/config.yml", Config.YAML);
if (Objects.equals(config.getString("secret"), "SECRET")) {
// Random String as Value for the issuer key
config.set("issuer", UUID.randomUUID().toString());
config.set("secret", UUID.randomUUID().toString());
config.save();
}

Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webapp",
"private": false,
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
8 changes: 5 additions & 3 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ export const App: React.FC = () => {
p: 1,
mt: 2
}}>
{active === "modules" && (
{(active === "modules" && !unauthenticated) && (
<Modules setError={setError} setSuccess={setSuccess} setUnauthenticated={() => setUnauthenticated(true)}/>
)}
{active === "players" && (
{(active === "players" && !unauthenticated) && (
<Players setError={setError} setSuccess={setSuccess} setUnauthenticated={() => setUnauthenticated(true)}/>
)}
{active === "banlist" && (
{(active === "banlist" && !unauthenticated) && (
<BanList setError={setError} setSuccess={setSuccess} setUnauthenticated={() => setUnauthenticated(true)}/>
)}
</Container>
Expand Down Expand Up @@ -234,6 +234,8 @@ export const App: React.FC = () => {
setLoginFailed(false);
login(username, password).then(() => {
setLoading(false);
setLoginFailed(false);
setUnauthenticated(false);
}).catch((error) => {
setLoading(false);
setLoginFailed(true);
Expand Down

0 comments on commit 38bc267

Please sign in to comment.