2017-04-15 10 views
0

최신 깃털 - 인증 - 클라이언트 및 깃털 인증 로컬을 사용하여 쿠키에 jwt 토큰을 저장하는 올바른 방법은 무엇입니까?feathers-authentication-local로 로그인하지만 jwt를 쿠키에 저장하는 올바른 방법은 무엇입니까?

문서를 찾을 수 없습니다. 이 코드는 localStorage에서 다음 코드를 사용하여 작동하지만 feathers-authenticaion-oauth2와 같은 쿠키 내에 저장하는 것이 좋습니다.

const host = 'http://localhost:3030'; 
export const app = feathers() 
    .configure(rest(host).superagent(superagent)) 
    .configure(feathers.hooks()) 
    .configure(auth({ 
    storage: localStorage, 
    type: 'jwt', 
    })); 

감사

답변

0

당신은 좋은 있지만 잘못된 문서에하고 있습니다. 이것을 시도해보십시오 https://docs.feathersjs.com/api/authentication/server.html.

인증을 구성하는 방법은 기존 pre-auk입니다. 그런 다음 feathers-authentication-client 및 feahters-authentication-local은 최신 auk입니다.

업데이트 : 2017 년 4 월 24 일 현재, auth local 및 socket.io와 auk 스타일 로그인 1.0+ 호환을 사용하여 이전 클라이언트 라이브러리 0.x를 유지하는 npm 패키지가 있습니다. feathers-authentication-compatibility