diff --git a/MySQL_conf_pbx/test1/docker-compose.yml b/MySQL_conf_pbx/test1/docker-compose.yml index ad51ba6..9a7cd9e 100755 --- a/MySQL_conf_pbx/test1/docker-compose.yml +++ b/MySQL_conf_pbx/test1/docker-compose.yml @@ -54,7 +54,7 @@ services: react_app: - image: mathewfrancisv/cezen_react:v1.0.0 + image: mathewfrancisv/cezen_react:v2.0.0 container_name: react_cezenpbx restart: always working_dir: /app diff --git a/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 b/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 index 74654a4..572970d 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 and b/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/aria_log_control b/MySQL_conf_pbx/test1/mariadb_data/aria_log_control index ebe2d8e..364c3d6 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/aria_log_control and b/MySQL_conf_pbx/test1/mariadb_data/aria_log_control differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user.ibd index 62121b3..65fcff2 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user_roles.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user_roles.ibd index 2bfc8a1..26cbe66 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user_roles.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user_roles.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 b/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 index 0a1223b..d9a15d0 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 and b/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ibdata1 b/MySQL_conf_pbx/test1/mariadb_data/ibdata1 index b9cb7d2..6c3ba9e 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/ibdata1 and b/MySQL_conf_pbx/test1/mariadb_data/ibdata1 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd index 21e9201..6a0f44f 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd and b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd index f6de378..f8bcaed 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd and b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo001 b/MySQL_conf_pbx/test1/mariadb_data/undo001 index 4007320..f015d50 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo001 and b/MySQL_conf_pbx/test1/mariadb_data/undo001 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo002 b/MySQL_conf_pbx/test1/mariadb_data/undo002 index 5230c87..5c9bbdf 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo002 and b/MySQL_conf_pbx/test1/mariadb_data/undo002 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo003 b/MySQL_conf_pbx/test1/mariadb_data/undo003 index ee69e21..ce5aeeb 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo003 and b/MySQL_conf_pbx/test1/mariadb_data/undo003 differ diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/.gitignore b/MySQL_conf_pbx/test1/reactcezenpbx/.gitignore old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/README.md b/MySQL_conf_pbx/test1/reactcezenpbx/README.md old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/eslint.config.js b/MySQL_conf_pbx/test1/reactcezenpbx/eslint.config.js old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/index.html b/MySQL_conf_pbx/test1/reactcezenpbx/index.html old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/package-lock.json b/MySQL_conf_pbx/test1/reactcezenpbx/package-lock.json old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/package.json b/MySQL_conf_pbx/test1/reactcezenpbx/package.json old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/public/CezenLogo.svg b/MySQL_conf_pbx/test1/reactcezenpbx/public/CezenLogo.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/public/CezenLogobig.png b/MySQL_conf_pbx/test1/reactcezenpbx/public/CezenLogobig.png old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/public/CezenLogobig.svg b/MySQL_conf_pbx/test1/reactcezenpbx/public/CezenLogobig.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/public/cezen_home_icon.svg b/MySQL_conf_pbx/test1/reactcezenpbx/public/cezen_home_icon.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/public/file.svg b/MySQL_conf_pbx/test1/reactcezenpbx/public/file.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/public/lite1.png b/MySQL_conf_pbx/test1/reactcezenpbx/public/lite1.png old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/public/vite.svg b/MySQL_conf_pbx/test1/reactcezenpbx/public/vite.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/App.css b/MySQL_conf_pbx/test1/reactcezenpbx/src/App.css old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/App.jsx b/MySQL_conf_pbx/test1/reactcezenpbx/src/App.jsx old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/assets/CezenLogo.svg b/MySQL_conf_pbx/test1/reactcezenpbx/src/assets/CezenLogo.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/assets/hammer-spanner-svgrepo-com.svg b/MySQL_conf_pbx/test1/reactcezenpbx/src/assets/hammer-spanner-svgrepo-com.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/assets/profile-circle-svgrepo-com.svg b/MySQL_conf_pbx/test1/reactcezenpbx/src/assets/profile-circle-svgrepo-com.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/assets/react.svg b/MySQL_conf_pbx/test1/reactcezenpbx/src/assets/react.svg old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/landing-page/home-page.css b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/landing-page/home-page.css old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/landing-page/homePage.jsx b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/landing-page/homePage.jsx old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/landing-page/navBar.jsx b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/landing-page/navBar.jsx old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/landing-page/navStyleImpl.css b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/landing-page/navStyleImpl.css old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/cezenBanar.jsx b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/cezenBanar.jsx old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/form_styling.css b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/form_styling.css old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/logIn.jsx b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/logIn.jsx old mode 100644 new mode 100755 index 2147351..7035e60 --- a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/logIn.jsx +++ b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/logIn.jsx @@ -1,4 +1,4 @@ -import { userLogin } from "../../http_routs/userHttp"; +import { userLoginAndResp } from "../../http_routs/userHttp"; export default function LogIn() { function logInFunction(event) { @@ -9,7 +9,7 @@ export default function LogIn() { const data = Object.fromEntries(formData.entries()); console.log(data); - userLogin(data.user_name, data.password); + userLoginAndResp(data.user_name, data.password); } return ( diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/logo_and_text.css b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/logo_and_text.css old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/signInup.jsx b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/signInup.jsx old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/signUp.jsx b/MySQL_conf_pbx/test1/reactcezenpbx/src/components/login-logout/signUp.jsx old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/http_routs/httpDomainName.js b/MySQL_conf_pbx/test1/reactcezenpbx/src/http_routs/httpDomainName.js old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/http_routs/userHttp.js b/MySQL_conf_pbx/test1/reactcezenpbx/src/http_routs/userHttp.js old mode 100644 new mode 100755 index 034dc7b..796c4c6 --- a/MySQL_conf_pbx/test1/reactcezenpbx/src/http_routs/userHttp.js +++ b/MySQL_conf_pbx/test1/reactcezenpbx/src/http_routs/userHttp.js @@ -33,20 +33,69 @@ export async function createUserNewAdmin(signUpObject = {}) { */ //user login data -export async function userLogin(username, password) { +// export async function userLogin(username, password) { +// //make an http get request for userLogin login + +// const loginResp = await fetch(`${socket}/open/login`, { +// method: `GET`, +// headers: basicAuthCredentialsBuilder(username, password), +// credentials: "include", // <-- VERY IMPORTANT to get the JWT cookie from the backend +// }); + +// const resData = await loginResp.json(); + +// console.log("response data"); +// console.log(resData); + +// return loginResp; +// } + +// //common basic auth header builder +// function basicAuthCredentialsBuilder(username, password) { +// //builds the appropriate format for basic auth +// return { +// Authorization: "Basic " + window.btoa(username + ":" + password), +// }; +// } + +export async function userLoginAndResp(username, password) { //make an http get request for userLogin login - const loginResp = await fetch(`${socket}/open/login`, { - method: `GET`, - headers: basicAuthCredentialsBuilder(username, password), - credentials: "include", // <-- VERY IMPORTANT - }); + const auth = new authenticationBuilder(socket); + + return auth.userLogin(username, password); } -//common basic auth header builder -function basicAuthCredentialsBuilder(username, password) { - //builds the appropriate format for basic auth - return { - Authorization: "Basic " + window.btoa(username + ":" + password), - }; +/** + * This class helps the user login + */ +class authenticationBuilder { + #socketURL = ""; + + constructor(socketURL) { + this.#socketURL = socketURL; + } + + async userLogin(username, password) { + //make an http get request for userLogin login + const loginResp = await fetch(`${this.#socketURL}/open/login`, { + method: `GET`, + headers: this.#basicAuthCredentialsBuilder(username, password), + credentials: "include", // <-- VERY IMPORTANT to get the JWT cookie from the backend + }); + + const resData = await loginResp.json(); + + console.log("response data"); + console.log(resData); + + return loginResp; + } + + #basicAuthCredentialsBuilder(username, password) { + //builds the appropriate format for basic auth + return { + Authorization: "Basic " + window.btoa(username + ":" + password), + }; + } } diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/index.css b/MySQL_conf_pbx/test1/reactcezenpbx/src/index.css old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/src/main.jsx b/MySQL_conf_pbx/test1/reactcezenpbx/src/main.jsx old mode 100644 new mode 100755 diff --git a/MySQL_conf_pbx/test1/reactcezenpbx/vite.config.js b/MySQL_conf_pbx/test1/reactcezenpbx/vite.config.js old mode 100644 new mode 100755