npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

adonis-ally-suap

v0.1.4

Published

Driver OAuth do SUAP para o Adonis Ally

Downloads

12

Readme

Driver OAuth para o AdonisJS Ally

Este pacote implementa um driver de autenticação do SUAP para o adonis ally (Autenticador de rede social do AdonisJS)

Instalação

ATENÇÃO: Esta instalação partirá da suposição de que as instruções de instalação do Ally foram seguidas corretamente, estando este instalado e configurado.

Realize a instalação do pacote utilizando o npm ou yarn.

npm install adonis-ally-suap

ou

yarn add adonis-ally-suap

Realize a configuração do pacote com o comando:

node ace configure adonis-ally-suap

Altere o arquivo contracts\ally.ts para conter o mapeamento de autenticação do SUAP.

//Não esquecer de importar o driver e sua configuração
import { SuapDriver, SuapDriverConfig } from 'adonis-ally-suap/build/standalone'

declare module '@ioc:Adonis/Addons/Ally' {
  interface SocialProviders {
    // ... outros mapeamentos
    suap: {
      config: SuapDriverConfig
      implementation: SuapDriver
    }
  }
}

Abra o arquivo env.ts e acrescente as duas variáveis de ambiente:

export default Env.rules({
  //...
  SUAP_CLIENT_ID: Env.schema.string(),
  SUAP_CLIENT_SECRET: Env.schema.string(),
  //...
})

Acrescente estas variáveis em seu arquivo de variáveis ambiente .env:

PORT=3333
HOST=0.0.0.0
NODE_ENV=development
#...
SUAP_CLIENT_ID=...
SUAP_CLIENT_SECRET=...

Para conseguir um Client ID e um Client Secret, acesse a página da API do SUAP.

Por fim, altere o arquivo config/ally.ts, para acrescentar o driver em sua configuração:

const allyConfig: AllyConfig = {
  // ... other drivers
  suap: {
    driver: 'suap',
    clientId: Env.get('SUAP_CLIENT_ID'),
    clientSecret: Env.get('SUAP_CLIENT_SECRET'),
    callbackUrl: 'http://localhost:3333/suap/callback',
  },
}

Observe que será necessário configurar corretamente o callback para receber o retorno do SUAP, mas uma vez que a instalação esteja realizada, a documentação do ally é a mesma para qualquer autenticador OAuth.