tamafull / devise_token_auth_trial

0 stars 0 forks source link

access-tokenを受ける #8

Closed tamafull closed 2 years ago

tamafull commented 2 years ago
axios
 .post(`/api/v1/auth/sign_in`, {
    email: this.email,
    password: this.password
  .then(response => {
    console.log('headers:', response.headers);
 })

とすると

cache-control: "no-store, must-revalidate, private, max-age=0"
content-type: "application/json; charset=utf-8"

しか取れない Networkタブで見るとちゃんと返ってきている

tamafull commented 2 years ago

Access-Control-Expose-Headersを設定すれば良さそう

tamafull commented 2 years ago

cors.rb

expose: ['access-token', 'client', 'uid'],

こう