Giter VIP home page Giter VIP logo

arc-plugin-oauth's People

Contributors

macdonst avatar ryanbethel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

arc-plugin-oauth's Issues

/login route can't find index.js imported from line 2 when deployed to AWS

When the plugin is deployed to AWS the line:

import arcOauth from '../../../index.js'

Which kinda makes sense as if you go 3 folders back from the lambda you are no longer in the lambda.

The stack trace is:

2022-03-22T03:31:09.885Z	undefined	ERROR	Uncaught Exception 	
{
    "errorType": "Error",
    "errorMessage": "Cannot find module '/index.js' imported from /var/task/index.mjs",
    "code": "ERR_MODULE_NOT_FOUND",
    "stack": [
        "Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/index.js' imported from /var/task/index.mjs",
        "    at new NodeError (internal/errors.js:322:7)",
        "    at finalizeResolution (internal/modules/esm/resolve.js:308:11)",
        "    at moduleResolve (internal/modules/esm/resolve.js:731:10)",
        "    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)",
        "    at Loader.resolve (internal/modules/esm/loader.js:89:40)",
        "    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)",
        "    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)",
        "    at link (internal/modules/esm/module_job.js:75:36)",
        "    at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:60:5)",
        "    at /var/runtime/deasync.js:23:15"
    ]
}

Missing dependency `tiny-json-http`

I've added arc-plugin-oauth to my project app.arc file:

@app
arc-fnh

@http
get /

@plugins
arc-plugin-oauth

@oauth
use-mock true

But when I try to run the sandbox I get the following error.

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'tiny-json-http' imported from $PROJECT_NAME/node_modules/arc-plugin-oauth/src/src/http/get-auth/oauth.mjs
    at new NodeError (internal/errors.js:322:7)
    at packageResolve (internal/modules/esm/resolve.js:687:9)
    at moduleResolve (internal/modules/esm/resolve.js:728:18)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)
    at link (internal/modules/esm/module_job.js:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

I think you'll need to make it a dependency or a peerDependency in order for it to work in sandbox.

Idea: CloudFront support via configurable HTTP route prefix

While implementing this plugin in my project, I found that Architect apps that rely on cookies (and therefore sessions) don't work behind CloudFront. The problem is that CloudFront strips cookies and query parameters before forwarding requests to API Gateway.

My solution was to fork and modify (snelgrove/arc-plugin-oauth@344b728) this plugin, adding a configurable prefix (e.g. "oauth") to the injected login, logout and auth routes. With a common path prefix, I created a CloudFront behavior that captures this plugin's routes and disables cache and passes cookies and query parameters through to routes with the pattern /oauth/*.

Is this something you'd be interested in including?

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.