class AuthenticatedUser < User
  def payload
    attrs = {
      "id" => id,
      "handle" => handle,
      "mfa" => mfa_level
    }
    attrs["email"] = email unless hide_email
    attrs
  end
end

# This enables us to return private fields, like mfa_level, to an authenticated user
# so that they may retrieve this information about their own profile without it
# being exposed to all users in their public profile
class AuthenticatedUser < User
  def payload
    super.merge({"mfa" => mfa_level})
  end
end

Call super and add a comment
Call super and add a comment
