Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
343ef14c
Commit
343ef14c
authored
Jul 08, 2020
by
Adrien Béraud
Browse files
OAuth: remember token scope
Change-Id: I5da233b3792215626fd82e827509ef95528e5be8
parent
7c8491ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/jamidht/server_account_manager.cpp
View file @
343ef14c
...
...
@@ -245,6 +245,7 @@ ServerAccountManager::setToken(std::string token, TokenScope scope)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
tokenLock_
);
token_
=
std
::
move
(
token
);
tokenScope_
=
scope
;
nameDir_
.
get
().
setToken
(
token_
);
if
(
not
token_
.
empty
())
{
auto
&
reqQueue
=
getRequestQueue
(
scope
);
...
...
@@ -374,7 +375,8 @@ ServerAccountManager::searchUser(const std::string& query, SearchCallback cb)
if
(
response
.
status_code
>=
200
&&
response
.
status_code
<
300
)
{
try
{
Json
::
Value
::
ArrayIndex
rcount
=
json
.
size
();
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
results
(
rcount
);
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
results
;
results
.
reserve
(
rcount
);
JAMI_WARN
(
"[Search] Got server response: %s"
,
response
.
body
.
c_str
());
for
(
Json
::
Value
::
ArrayIndex
i
=
0
;
i
<
rcount
;
i
++
)
{
const
auto
&
ruser
=
json
[
i
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment