Socket
Socket
Sign inDemoInstall

@mikield/adonis-ally-extended

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mikield/adonis-ally-extended

Additional Services for AdonisJS Ally package


Version published
Maintainers
1
Created

Readme

Source

Welcome to Adonis Ally Extended 👋

Version Documentation Maintenance License: MIT Twitter: AdmiralMiki

This package gives you additional social services to auth your users.

Any of service that accepts OAuth can be added. If you want an additional service - please create a issue and I will take my time to add it. Avaiable services for now are:

  • Twitch.tv
  • Mixer.com
  • Vk.com (Thanks to @oddie)
  • Patreon.com (Thanks to @mindofjonas)

Install

adonis install @mikield/adonis-ally-extended
The provider will be registered inside start/app.js file.
const providers = [
  '@mikield/adonis-ally-extended/ServiceProvider'
]
Add additional fields to config/services.js file.
...
/*
 |--------------------------------------------------------------------------
 | Vk Configuration
 |--------------------------------------------------------------------------
 |
 | You can access your application credentials from the vk developers
 | page. https://vk.com/apps?act=manage
 |
 */
vk: {
  clientId: Env.get('VK_CLIENT_ID'),
  clientSecret: Env.get('VK_CLIENT_SECRET'),
  redirectUri: `${Env.get('APP_URL')}/authenticated/vk`
},

/*
 |--------------------------------------------------------------------------
 | Twitch Configuration
 |--------------------------------------------------------------------------
 |
 | You can access your application credentials from the twitch developers
 | dashboard. https://dev.twitch.tv/dashboard
 |
 */
twitch: {
  clientId: Env.get('TWITCH_CLIENT_ID'),
  clientSecret: Env.get('TWITCH_CLIENT_SECRET'),
  redirectUri: `${Env.get('APP_URL')}/authenticated/twitch`
},

/*
 |--------------------------------------------------------------------------
 | Mixer Configuration
 |--------------------------------------------------------------------------
 |
 | You can access your application credentials from the Mixer developers
 | lab. https://mixer.com/lab/oauth
 |
 */
mixer: {
  clientId: Env.get('MIXER_CLIENT_ID'),
  clientSecret: Env.get('MIXER_CLIENT_SECRET'),
  redirectUri: `${Env.get('APP_URL')}/authenticated/mixer`
},

/*
 |--------------------------------------------------------------------------
 | Patreon Configuration
 |--------------------------------------------------------------------------
 |
 | You can access your application credentials from the Patreon developers
 | lab. https://www.patreon.com/developers
 |
 */
patreon: {
  clientId: Env.get('MIXER_CLIENT_ID'),
  clientSecret: Env.get('MIXER_CLIENT_SECRET'),
  redirectUri: `${Env.get('APP_URL')}/authenticated/mixer`
}
...

Usage

Now you can access, the ally object on each HTTP request

Route.get('/:service', async ({ request, ally }) => {
  let {service} = await request.all()
  await ally.driver(service).redirect()
})

Route.get('authenticated/:service', async ({ request, ally }) => {
  let {service} = await request.all()
  const user = await ally.driver(service).getUser()

  return user
})

Author

👤 Vladyslav Gaysyuk hello@mikield.rocks

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 Vladyslav Gaysyuk.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

Keywords

FAQs

Last updated on 08 Apr 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc