Giter Club home page Giter Club logo

Comments (5)

gaand avatar gaand commented on July 19, 2024

These fixes also belong in the whole jquery-ajax-* sequence.

First, #22

Also, this scheme (ish) for the JSON scripts:

#!/bin/bash

# API="http://httpbin.org"
# APIPATH="/post"
API="http://localhost:4741"
APIPATH="/sign-in"
curl ${API}${APIPATH} \
  --include \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "credentials": {
      "email": "'${EMAIL}'",
      "password": "'${PASSWORD}'"
    }
  }'

# data output from curl doesn't have a trailing newline
echo

from api-token-auth.

jrhorn424 avatar jrhorn424 commented on July 19, 2024

Did we come to a decision about whether or not it's OK to hard-code the vars inside the script? We discussed on Slack briefly in 015-planning. @gaand and I argued against hard-coding, favoring passing at execution at the prompt. @payne-chris-r Noted a bug may occur with an incorrect token if the variables are hard-coded, and therefore leaked to the environment.

from api-token-auth.

jrhorn424 avatar jrhorn424 commented on July 19, 2024

I will deliver better scripts this time by sharing through 015-code, then I'll save a gist and link it across the open issues.

from api-token-auth.

gaand avatar gaand commented on July 19, 2024

I haven't pushed the branch, but I'm making this change to rails-api-template:

 #!/bin/bash
 
-API="http://localhost:4741"
+API="${API_ORIGIN:-http://localhost:4741}"
 URL_PATH="/sign-in"
 curl "${API}${URL_PATH}" \
   --include \

from api-token-auth.

gaand avatar gaand commented on July 19, 2024

I pushed ga-wdi-boston/rails-api-template@2b97302

from api-token-auth.

Related Issues (20)

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.