diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 290ffee6..080027c0 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -75,14 +75,9 @@ OUTSTANDING WITH CUSTOMER PW / Login generator automatically and sends creds need code that generates easily enterable urls if pw starts with "TEMP" or some key token then maybe they need to go to the change password automatically upon login - this way can issue a pw and email it and when user first logs in they must set it to something? - - - contacts - Maybe convert generic customer contacts list to proper data grid source from server - shows customer, headoffice name directly in grid - Change cust-user edit form (and other user edit form) and add tabs and user options section so that it can all be set there as well + this way can issue a pw and email it and when user first logs in they must set it to something? Add button to email the user their creds and login and invite them to change the password once they login + prepend-icon="$ayiMagic" Customer User (contacts) UI for this client (generate, view) case for this and notes, sb very simple way to create and send creds for user Customer User / User(s) diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index 46a9ca21..f7414245 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -243,6 +243,20 @@ export default { } return hash; }, + + //////////////////////////////////////// + // Random password / login generator + // https://stackoverflow.com/a/51540480/8939 + // using 32 character (128 bit) as default + // + getRandomPassword: function() { + let length = 32, + wishlist = "0123456789abcdefghijkmnopqrstuvwxyz"; + + return Array.from(crypto.getRandomValues(new Uint32Array(length))) + .map(x => wishlist[x % wishlist.length]) + .join(""); + }, /////////////////////////////// // CONVERT STRING TO BOOLEAN // https://stackoverflow.com/a/1414175/8939 diff --git a/ayanova/src/plugins/vuetify.js b/ayanova/src/plugins/vuetify.js index 436b4eab..785b1019 100644 --- a/ayanova/src/plugins/vuetify.js +++ b/ayanova/src/plugins/vuetify.js @@ -105,6 +105,7 @@ import { faLink, faListOl, faListUl, + //faMagic, faMapMarkerAlt, faMapMarkedAlt, faMinus, @@ -255,6 +256,7 @@ library.add( faLink, faListOl, faListUl, + //faMagic, faMapMarkerAlt, faMapMarkedAlt, faMinus, @@ -792,6 +794,12 @@ const CUSTOM_ICONS = { icon: ["fas", "list-ul"] } }, + // ayiMagic: { + // component: FontAwesomeIcon, + // props: { + // icon: ["fas", "magic"] + // } + // }, ayiMapMarker: { component: FontAwesomeIcon, props: { diff --git a/ayanova/src/views/cust-user.vue b/ayanova/src/views/cust-user.vue index 5f87a1b5..3fe53744 100644 --- a/ayanova/src/views/cust-user.vue +++ b/ayanova/src/views/cust-user.vue @@ -428,6 +428,8 @@ export default { await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading } } else { + vm.password = window.$gz.util.getRandomPassword(); + vm.login = window.$gz.util.getRandomPassword(); /* Customer = 3, HeadOffice = 4, */ if (vm.$route.params.customerid && vm.$route.params.customerid != 0) {