- with {:ok, user_id} <- Phoenix.Token.verify(socket, "user socket", token, max_age: 84600),
- %User{} = user <- Pleroma.Repo.get(User, user_id) do
- {:ok, assign(socket, :user, user)}
+ with true <- Pleroma.Config.get([:shout, :enabled]),
+ {:ok, user_id} <- Phoenix.Token.verify(socket, "user socket", token, max_age: 84_600),
+ %User{} = user <- Pleroma.User.get_cached_by_id(user_id) do
+ {:ok, assign(socket, :user_name, user.nickname)}