Generate IDs cryptographically securely on the server

This commit is contained in:
2017-01-09 18:19:24 -07:00
parent 4638db1f7f
commit 33d7fb4294
4 changed files with 19 additions and 6 deletions

View File

@@ -31,11 +31,11 @@ export default class Site extends React.Component {
if (localStorage.getItem('id')) {
this.state.id = url || localStorage.getItem('id');
} else {
this.state.id = url || Shortid.generate();
this.state.id = url || secureID || Shortid.generate();
}
localStorage.setItem('id', this.state.id);
} else {
this.state.id = url || Shortid.generate();
this.state.id = url || secureID || Shortid.generate();
}
}