- def create_authorization(%App{} = app, %User{} = user) do
- token = :crypto.strong_rand_bytes(32) |> Base.url_encode64()
+ def create_authorization(%App{} = app, %User{} = user, scopes \\ nil) do
+ scopes = scopes || app.scopes
+ token = :crypto.strong_rand_bytes(32) |> Base.url_encode64(padding: false)