From 94e3bcfb9803a1bbe28dd574cecd1e923156450b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Sat, 7 Sep 2024 18:16:21 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20#111=20=EA=B5=AC=EA=B8=80=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=ED=83=88=ED=87=B4=20=EC=95=88=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/DTO/Auth/WithdrawRequest.swift | 4 +- .../Sources/Setting/PokitSettingFeature.swift | 39 ++++++++++--------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Projects/CoreKit/Sources/Data/DTO/Auth/WithdrawRequest.swift b/Projects/CoreKit/Sources/Data/DTO/Auth/WithdrawRequest.swift index 61369568..e01a01f7 100644 --- a/Projects/CoreKit/Sources/Data/DTO/Auth/WithdrawRequest.swift +++ b/Projects/CoreKit/Sources/Data/DTO/Auth/WithdrawRequest.swift @@ -9,11 +9,9 @@ import Foundation /// ํšŒ์›ํƒˆํ‡ด API Request /// ๐Ÿ“Œ ํšŒ์›ํƒˆํ‡ด๋Š” Response๊ฐ€ ์—†์Œ public struct WithdrawRequest: Encodable { - public let refreshToken: String public let authPlatform: String - public init(refreshToken: String, authPlatform: String) { - self.refreshToken = refreshToken + public init(authPlatform: String) { self.authPlatform = authPlatform } } diff --git a/Projects/Feature/FeatureSetting/Sources/Setting/PokitSettingFeature.swift b/Projects/Feature/FeatureSetting/Sources/Setting/PokitSettingFeature.swift index d2839652..698db99e 100644 --- a/Projects/Feature/FeatureSetting/Sources/Setting/PokitSettingFeature.swift +++ b/Projects/Feature/FeatureSetting/Sources/Setting/PokitSettingFeature.swift @@ -213,30 +213,31 @@ private extension PokitSettingFeature { return } - guard let authCode = userDefaults.stringKey(.authCode) else { - print("authCode๊ฐ€ ์—†์–ด์„œ ๋ฒ—์–ด๋‚จ") - return - } - - guard let jwt = userDefaults.stringKey(.jwt) else { - print("jwt๊ฐ€ ์—†์–ด์„œ ๋ฒ—์–ด๋‚จ") - return + if platform == "์• ํ”Œ" { + guard let authCode = userDefaults.stringKey(.authCode) else { + print("authCode๊ฐ€ ์—†์–ด์„œ ๋ฒ—์–ด๋‚จ") + return + } + + guard let jwt = userDefaults.stringKey(.jwt) else { + print("jwt๊ฐ€ ์—†์–ด์„œ ๋ฒ—์–ด๋‚จ") + return + } + + guard let serverRefreshToken = keychain.read(.serverRefresh) else { return } + + try await authClient.appleRevoke( + serverRefreshToken, + AppleTokenRequest( + authCode: authCode, + jwt: jwt + ) + ) } - guard let serverRefreshToken = keychain.read(.serverRefresh) else { return } - await send(.async(.ํ‚ค_์ œ๊ฑฐ)) - try await authClient.appleRevoke( - serverRefreshToken, - AppleTokenRequest( - authCode: authCode, - jwt: jwt - ) - ) - let request = WithdrawRequest( - refreshToken: serverRefreshToken, authPlatform: platform )