authorization flow added

This commit is contained in:
2022-07-12 23:50:12 +05:30
parent 9b5e916709
commit 7ddda30b31
4 changed files with 189 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
/**
* Generates a random string containing numbers and letters
* @param {number} length The length of the string
* @return {string} The generated string
*/
module.exports = (length) => {
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let text = '';
for (let i = 0; i < length; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
};