diff --git a/src/main/java/link/locutus/discord/web/WebUtil.java b/src/main/java/link/locutus/discord/web/WebUtil.java index 282f7acd..d9cfcbda 100644 --- a/src/main/java/link/locutus/discord/web/WebUtil.java +++ b/src/main/java/link/locutus/discord/web/WebUtil.java @@ -66,7 +66,7 @@ public static void mailLogin(DBNation nation, boolean backend, boolean allowExis if (mails.size() > 0) { mailUrl = Settings.INSTANCE.PNW_URL() + "/inbox/message/id=" + mails.get(0).id; } else { - mailUrl = Settings.INSTANCE.PNW_URL() + "/mail/inbox"; + mailUrl = Settings.INSTANCE.PNW_URL() + "/inbox/"; } throw new RedirectResponse(HttpStatus.SEE_OTHER, mailUrl); } else { diff --git a/src/main/java/link/locutus/discord/web/commands/binding/AuthBindings.java b/src/main/java/link/locutus/discord/web/commands/binding/AuthBindings.java index fff104a0..e0c212ea 100644 --- a/src/main/java/link/locutus/discord/web/commands/binding/AuthBindings.java +++ b/src/main/java/link/locutus/discord/web/commands/binding/AuthBindings.java @@ -319,7 +319,10 @@ record = WebRoot.db().get(uuid); UUID uuid = UUID.fromString(token); if (record == null || !record.getUUID().equals(uuid)) { record = WebRoot.db().get(uuid); - WebUtil.setCookie(context, PageHandler.CookieType.URL_AUTH.getCookieId(), uuid.toString(), (int) TimeUnit.DAYS.toSeconds(Settings.INSTANCE.WEB.SESSION_TIMEOUT_DAYS)); + if (record != null) { + isLoginPage = false; + WebUtil.setCookie(context, PageHandler.CookieType.URL_AUTH.getCookieId(), uuid.toString(), (int) TimeUnit.DAYS.toSeconds(Settings.INSTANCE.WEB.SESSION_TIMEOUT_DAYS)); + } } } catch (IllegalArgumentException e) { e.printStackTrace();