Code Monkey home page Code Monkey logo

demo-eleventy-serverless-oauth's People

Contributors

harunhasdal avatar jmhobbs avatar zachleat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

demo-eleventy-serverless-oauth's Issues

Specifying the --port breaks auth

I noticed that npm run dev generates the following output:

[Browsersync] Access URLs:
 -------------------------------
    Local: http://localhost:8080
 External: http://false:8080
 -------------------------------
[Browsersync] Serving files from: _site

   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘

I thought it was odd that the two local URLs had different ports. I tried specifying other ports in package.json by adding --port=8081 to the build and start scripts, but then got 404 errors for /.netlify/functions/auth-before. It looks like 8888 is hard-coded here:

const SITE_URL = process.env.URL || 'http://localhost:8888';

Should the demo project be able to work with ports other than 8888? Or is this the mismatch a requirement for Netlify functions?

Thanks! Sorry for not attempting a PR, I'm still a bit new to Eleventy.

Add repository license?

Could you please add a license file for this repository, if that aligns with your intended use for it? Thank you!

Proposed Provider: Stack Overflow / Stack Exchange

Documentation

Broad steps (to be validated)

  1. Get the app's OAuth Domain to be used on the app registration at https://stackapps.com
  2. Register the OAuth app at https://stackapps.com/apps/oauth/register and get the Stack Overflow Oauth client id and client secret.
  3. Add the STACKEXCHANGE_OAUTH_CLIENT_ID and STACKEXCHANGE_OAUTH_CLIENT_SECRET to the corresponding site on Netlify.
  4. Update providers.js and auth.js in netlify/functions/Utils
    • Add Stack Exchange to a new provider.
      Notes:
      1. There are two domains to be used: https://stackoverflow.com for authentication and https://api.stackexchange.com to get the user data.
      2. On Stack Overflow/Stack Exchange OAuth it is required to set a site name, i.e., stackoverflow, meta, webapps, etc. A basic setup might use a hardcoded site name. Ideally, the form should include a select so the user can select the source of the site user profile. Another approach might be to show the user data from the Stack Exchange network profile instead but this should be told to the user.
  5. Add a Stack Overflow / Stack Exchange login button to the static form.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.