Hi i created a flow using the ui to programatically create a directus user on an action trigger. I wonder if there is any way we can run the random string utility for generating a static token in the flows?
2 Answers
2You can consider using a custom code block to generate a random string.
function generateRandomString32() {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < 32; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
return result;
}
