Added User to AuthenticatedAction

This commit is contained in:
2026-08-25 23:37:40 +03:00
parent 9bfee2978e
commit 8582a92d85
4 changed files with 41 additions and 12 deletions
+16
View File
@@ -0,0 +1,16 @@
package utils
import java.nio.ByteBuffer
import java.security.SecureRandom
import java.util.Base64
object Random {
private lazy val random = SecureRandom()
private lazy val base64 = Base64.getEncoder
def randomBase64(bytes: Int): String = {
val tokenRaw = ByteBuffer.allocate(bytes)
random.nextBytes(tokenRaw.array())
base64.encodeToString(tokenRaw.array())
}
}