lukeocodes / lukeocodes/hacktoberfest-checker

auth with GitHub using nuxt auth module

Open
#48 8 comments 0 reactions 1 assignee View on GitHub

@git-srinivas is already working on this.

Since Oct 22, 2020.

enhancement hacktoberfest help wanted
Dominant language
JavaScript
Stars
16
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Editing with info for anyone who wants to help with this one.

There are a few ways to connect to GitHub APIs.

One is using a static personal access token (mine), which is stored as an environment variable and deployed to the Netlify Function (AWS Lambda function) that connects to GitHub.

Another way is to have a user of the site "Login with GitHub", they then get an Acess Token which can be stored in the memory of the frontend application (not in cookies or local storage), then sent through to the Netlify Function whenever they make a request. Not only for this purpose, but it also will provide the users GitHub profile information, to enrich the experience on the site (i.e. they could track their entire Hacktoberfest progress).

There are packages like nuxt-auth that will make some of this work easier, but from my own experimentation, those packages offered incomplete solutions. I believe I was closest with nuxt-auth, which appeared to be using an auth code grant, but I should have created a new Netlify Function to act as the backend to exchange the authorization code for an access token.

GitHub has some guides on building an OAuth application.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.