AccessToken - refreshToken 관련 로직 추가

This commit is contained in:
hyunwoo93.cha
2024-05-08 16:17:49 +09:00
parent 40fe7f2587
commit 49b16d8cdf
4 changed files with 39 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ export const types = {
// device actions // device actions
GET_AUTHENTICATION_CODE: "GET_AUTHENTICATION_CODE", GET_AUTHENTICATION_CODE: "GET_AUTHENTICATION_CODE",
GET_RE_AUTHENTICATION_CODE: "GET_RE_AUTHENTICATION_CODE",
REGISTER_DEVICE: "REGISTER_DEVICE", REGISTER_DEVICE: "REGISTER_DEVICE",
REGISTER_DEVICE_INFO: "REGISTER_DEVICE_INFO", REGISTER_DEVICE_INFO: "REGISTER_DEVICE_INFO",
GET_DEVICE_INFO: "GET_DEVICE_INFO", GET_DEVICE_INFO: "GET_DEVICE_INFO",

View File

@@ -1,7 +1,7 @@
import { URLS } from "../api/apiConfig"; import { URLS } from '../api/apiConfig';
import { TAxios } from "../api/TAxios"; import { TAxios } from '../api/TAxios';
import { types } from "./actionTypes"; import { types } from './actionTypes';
import { changeLocalSettings } from "./commonActions"; import { changeLocalSettings } from './commonActions';
// IF-LGSP-000 인증코드 요청 // IF-LGSP-000 인증코드 요청
export const getAuthenticationCode = () => (dispatch, getState) => { export const getAuthenticationCode = () => (dispatch, getState) => {
@@ -127,3 +127,30 @@ export const getDeviceAdditionInfo = () => (dispatch, getState) => {
onFail onFail
); );
}; };
// 인증번호 재요청 IF-LGSP-096
export const getReAuthenticationCode = () => (dispatch, getState) => {
const onSuccess = (response) => {
console.log("getReAuthenticationCode onSuccess: ", response.data);
dispatch({
type: types.GET_RE_AUTHENTICATION_CODE,
payload: response.data.data,
});
};
const onFail = (error) => {
console.error("getReAuthenticationCode onFail: ", error);
};
TAxios(
dispatch,
getState,
"get",
URLS.GET_RE_AUTHENTICATION_CODE,
{},
{},
onSuccess,
onFail
);
};

View File

@@ -1,7 +1,10 @@
import axios from "axios"; import axios from 'axios';
import * as HelperMethods from "../utils/helperMethods"; import * as HelperMethods from '../utils/helperMethods';
import { getUrl, URLS } from "./apiConfig"; import {
getUrl,
URLS,
} from './apiConfig';
// refresh-token 구현 필요 // refresh-token 구현 필요
let tokenRefreshing = false; let tokenRefreshing = false;

View File

@@ -4,6 +4,7 @@ export const SHOPTIME_BASE_URL = ".lgshopsvc.lgappstv.com";
export const URLS = { export const URLS = {
//device controller //device controller
GET_AUTHENTICATION_CODE: "/lgsp/v1/device/auth.lge", GET_AUTHENTICATION_CODE: "/lgsp/v1/device/auth.lge",
GET_RE_AUTHENTICATION_CODE: "/lgsp/v1/device/reauth.lge",
GET_DEVICE_ADDITION_INFO: "/lgsp/v1/device/info/addition.lge", GET_DEVICE_ADDITION_INFO: "/lgsp/v1/device/info/addition.lge",
DELETE_DEVICE_ADDITION_INFO: "/lgsp/v1/device/info/addition/delete.lge", DELETE_DEVICE_ADDITION_INFO: "/lgsp/v1/device/info/addition/delete.lge",
DELETE_DEVICE_PAIRING: "/lgsp/v1/device/pairing/delete.lge", DELETE_DEVICE_PAIRING: "/lgsp/v1/device/pairing/delete.lge",