mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
auth: added backend debugging
This commit is contained in:
parent
c2e13ba4fd
commit
8ddd7d624a
1 changed files with 8 additions and 2 deletions
|
@ -6,7 +6,7 @@ const { STRINGS } = require('../../../config/strings');
|
||||||
const fetchUserData = async (req, res) => {
|
const fetchUserData = async (req, res) => {
|
||||||
const { query: { user_id, access_token } } = req;
|
const { query: { user_id, access_token } } = req;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const result = await axios.get(
|
||||||
'https://api.vk.com/method/users.get',
|
'https://api.vk.com/method/users.get',
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
|
@ -17,9 +17,15 @@ const fetchUserData = async (req, res) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
).catch(() => {
|
).catch(() => {
|
||||||
return res.send({ success: false, error: 'iframe auth failed' });
|
res.send({ success: false, error: 'iframe auth failed' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { data } = result;
|
||||||
|
if (!data) {
|
||||||
|
console.log('OOOPS!', result);
|
||||||
|
res.send({ success: false, error: 'iframe auth failed', result });
|
||||||
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue