#include "identity_provider.hpp"

namespace fz::authentication
{

std::optional<bool> identity_provider::parameters::multi_value::as_bool() const
{
	if (value_) {
		if (*value_ == "true" || *value_ == "1") {
			return true;
		}

		if (*value_ == "false" || *value_ == "0") {
			return false;
		}
	}

	return std::nullopt;
}

const std::string &identity_provider::parameters::multi_value::as_string() const
{
	if (value_) {
		return *value_;
	}

	static const std::string empty;
	return empty;
}

}
