You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 jaren geleden
123456789101112131415161718192021222324
  1. module.exports = {
  2. provider: async function(options, name) {
  3. const oauth = await this.setOAuthProvider(name, options)
  4. return {
  5. access_token: oauth.access_token,
  6. refresh_token: oauth.refresh_token
  7. };
  8. },
  9. authorize: async function(options) {
  10. const oauth = await this.getOAuthProvider(options.provider);
  11. return oauth.authorize(this.parse(options.scopes), this.parse(options.params));
  12. },
  13. refresh: async function(options) {
  14. const oauth = await this.getOAuthProvider(options.provider);
  15. return oauth.refreshToken(this.parse(options.refresh_token));
  16. },
  17. };