diff --git a/public/js/app.js b/public/js/app.js index 227c33b..633d3ac 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -10,8 +10,36 @@ class App { */ constructor(serverUrl) { this.serverUrl = serverUrl; + this.session.serverUrl = serverUrl; } + /** + * Session object. + * @type {object} session + */ + session = { + /** + * Check the current session. + * @returns {Promise} The session data. + */ + async check() { + const response = await fetch(`${this.serverUrl}/sessions/current`, { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }); + + const data = await response.json(); + + if (data.status === "success") { + return data.data; + } else { + return null; + } + }, + }; + /** * Display a notification message in an element. * @param {string} type - The type of notification. diff --git a/views/home.ejs b/views/home.ejs index 824eca1..a1c48e7 100644 --- a/views/home.ejs +++ b/views/home.ejs @@ -3,7 +3,19 @@ <%- include("./components/head") %> + + Tridecco + diff --git a/views/login.ejs b/views/login.ejs index e54b112..c04562d 100644 --- a/views/login.ejs +++ b/views/login.ejs @@ -6,6 +6,16 @@ Login + diff --git a/views/password-reset.ejs b/views/password-reset.ejs index e132a3c..85598e7 100644 --- a/views/password-reset.ejs +++ b/views/password-reset.ejs @@ -6,6 +6,16 @@ Password Reset + diff --git a/views/register.ejs b/views/register.ejs index 1151d17..f86cd63 100644 --- a/views/register.ejs +++ b/views/register.ejs @@ -6,6 +6,16 @@ Register + diff --git a/views/two-factor-authentication.ejs b/views/two-factor-authentication.ejs index 10887fc..3f00bb4 100644 --- a/views/two-factor-authentication.ejs +++ b/views/two-factor-authentication.ejs @@ -5,7 +5,17 @@ <%- include("./components/head") %> - Register + Two Factor Authentication + @@ -53,7 +63,7 @@