0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd: Support authorization: bearer access tokens.

This commit is contained in:
Jason Volk 2018-02-10 22:03:39 -08:00
parent 8044fdb3ce
commit b1d257c93a

View file

@ -129,11 +129,22 @@ ircd::authenticate(client &client,
resource::request &request) resource::request &request)
try try
{ {
const string_view &access_token string_view access_token
{ {
request.query.at("access_token") request.query["access_token"]
}; };
if(empty(access_token))
{
const auto authorization
{
split(request.head.authorization, ' ')
};
if(iequals(authorization.first, "bearer"_sv))
access_token = authorization.second;
}
const bool result const bool result
{ {
access_token && access_token &&