Skip to content

Commit 83ef7a3

Browse files
committed
refactor: 강제 옵셔널 언래핑 제거
1 parent fb58eea commit 83ef7a3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

DevLog/Infra/Service/SocialLogin/GithubAuthenticationService.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,11 @@ final class GithubAuthenticationService: NSObject, AuthenticationService {
243243

244244
// GitHub API로 사용자 프로필 정보 가져오기
245245
func requestUserProfile(accessToken: String) async throws -> GitHubUser {
246-
var request = URLRequest(url: URL(string: "https://api.github.com/user")!)
246+
guard let url = URL(string: "https://api.github.com/user") else {
247+
throw URLError(.badURL)
248+
}
249+
250+
var request = URLRequest(url: url)
247251
request.httpMethod = "GET"
248252
request.addValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
249253
request.addValue("application/vnd.github.v3+json", forHTTPHeaderField: "Accept")
@@ -272,7 +276,11 @@ final class GithubAuthenticationService: NSObject, AuthenticationService {
272276
}
273277

274278
func requestPrimaryVerifiedEmail(accessToken: String) async throws -> String? {
275-
var request = URLRequest(url: URL(string: "https://api.github.com/user/emails")!)
279+
guard let url = URL(string: "https://api.github.com/user/emails") else {
280+
throw URLError(.badURL)
281+
}
282+
283+
var request = URLRequest(url: url)
276284
request.httpMethod = "GET"
277285
request.addValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
278286
request.addValue("application/vnd.github.v3+json", forHTTPHeaderField: "Accept")

0 commit comments

Comments
 (0)