Skip to content

Commit dfa7285

Browse files
authored
Merge pull request #177 from GalvinGao/main
fix: idToken Invalid top-level type in JSON write
2 parents aa2a49f + 0aeb058 commit dfa7285

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ios/LineLoginModule.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,17 @@ import LineSDK
135135
}
136136

137137
private func parseAccessToken(_ token: AccessToken) -> NSDictionary {
138-
return [
138+
var result = [
139139
"accessToken": token.value,
140140
"createdAt": token.createdAt,
141141
"expiresIn": token.expiresAt,
142-
"idToken": try? JSONSerialization.data(withJSONObject: token.IDToken ?? [:], options: [])
143-
]
142+
] as [String : Any]
143+
144+
if let idToken = token.IDTokenRaw {
145+
result["idToken"] = idToken
146+
}
147+
148+
return NSDictionary(dictionary: result)
144149
}
145150

146151
private func parseFriendshipStatus(_ status: GetBotFriendshipStatusRequest.Response) -> NSDictionary {

0 commit comments

Comments
 (0)