Code Monkey home page Code Monkey logo

grape-knock's People

Contributors

gottfrois avatar malagant avatar max-konin avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

grape-knock's Issues

uninitialized constant JWT

I got this error when running an RSpec test:

NameError:
       uninitialized constant JWT
     # ./spec/api/students_spec.rb:5:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Grape::Knock::ForbiddenError:
     #   Grape::Knock::ForbiddenError

To fix, I had to require 'jwt' at the top of my grape API class. Is that expected? It's not mentioned in the README.

Response to preflight request doesn't include 'Access-Control-Allow-Origin' header

I am not sure if it's the problem from Grape::Knock::Authenticable, my front-end is a Vue project running on port 8080, and grape is on 3000. once I add use Grape::Knock::Authenticable in grape api, the browser print following error:

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.

I tried to add header manual but seems no effect

module Depot
  class API < Grape::API
    version 'v1', using: :path
    format :json
    prefix :api

    before do
      header "Access-Control-Allow-Origin", "*"
      header "Access-Control-Allow-Headers", "Authorization, Content-Type"
      header "Access-Control-Allow-Methods", "GET, PUT, POST, DELETE, OPTIONS"
    end

Any idea?

Affected version: 0.1.1

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.