Skip to content

Commit 94d1655

Browse files
committed
build fixes
1 parent 11b4042 commit 94d1655

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

examples/vkontakte.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
const fastify = require('fastify')({ logger: { level: 'trace' } });
2-
const oauthPlugin = require('fastify-oauth2');
1+
const fastify = require('fastify')({ logger: { level: 'trace' } })
2+
const oauthPlugin = require('fastify-oauth2')
33

44
fastify.register(oauthPlugin, {
5-
name : 'vkOAuth2',
6-
scope : ['email'],
5+
name: 'vkOAuth2',
6+
scope: ['email'],
77
credentials: {
88
client: {
9-
id : process.env.CLIENT_ID,
10-
secret : process.env.CLIENT_SECRET
9+
id: process.env.CLIENT_ID,
10+
secret: process.env.CLIENT_SECRET
1111
},
12-
auth : oauthPlugin.VKONTAKTE_CONFIGURATION
12+
auth: oauthPlugin.VKONTAKTE_CONFIGURATION
1313
},
1414
startRedirectPath: '/login/vk',
1515
callbackUri: `http://localhost:${process.env.PORT}/login/vk/callback`
16-
});
16+
})
1717

1818
fastify.get('/login/vk/callback', async (req, reply) => {
19-
const token = await fastify.getAccessTokenFromAuthorizationCodeFlow(req);
19+
const token = await fastify.getAccessTokenFromAuthorizationCodeFlow(req)
2020

21-
console.log(token);
22-
reply.send({ access_token: token.access_token });
23-
});
21+
console.log(token)
22+
reply.send({ access_token: token.access_token })
23+
})
2424

2525
fastify.listen(process.env.PORT, (err, address) => {
2626
if (err) {
27-
fastify.log.error(err);
28-
process.exit(1);
27+
fastify.log.error(err)
28+
process.exit(1)
2929
}
30-
fastify.log.info(`server listening on ${address}`);
31-
});
30+
fastify.log.info(`server listening on ${address}`)
31+
})

0 commit comments

Comments
 (0)