diff options
Diffstat (limited to 'auth.js')
-rw-r--r-- | auth.js | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -2,8 +2,8 @@ export default { async logIn(graffitiURL) { // Generate a random client secret and state - const clientSecret = this.randomString() - const state = this.randomString() + const clientSecret = crypto.randomUUID() + const state = crypto.randomUUID() // The client ID is the secret's hex hash const clientID = await this.sha256(clientSecret) @@ -114,10 +114,6 @@ export default { return url }, - randomString() { - return Math.random().toString(36).substr(2) - }, - async sha256(input) { const encoder = new TextEncoder() const inputBytes = encoder.encode(input) |