mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
ircd: Support authorization: bearer access tokens.
This commit is contained in:
parent
8044fdb3ce
commit
b1d257c93a
1 changed files with 13 additions and 2 deletions
|
@ -129,11 +129,22 @@ ircd::authenticate(client &client,
|
|||
resource::request &request)
|
||||
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
|
||||
{
|
||||
access_token &&
|
||||
|
|
Loading…
Reference in a new issue