Skip to content

Commit

Permalink
fix: Firebase 인증 파일 읽기 오류
Browse files Browse the repository at this point in the history
- jar 파일로 배포하기 때문에 getFile()이 아닌 getInputStream()을 사용해야 한다.
  • Loading branch information
csct3434 committed Oct 25, 2024
1 parent 8be0963 commit 4d59040
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Component;

import java.io.FileInputStream;
import java.io.InputStream;

@Slf4j
@Component
Expand All @@ -30,7 +30,7 @@ public FirebaseConfig(@Value("${firebase.credential-path}") String path, Resourc
@PostConstruct
public void init() {
try {
FileInputStream serviceAccount = new FileInputStream(resourceLoader.getResource(CREDENTIAL_PATH).getFile());
InputStream serviceAccount = resourceLoader.getResource(CREDENTIAL_PATH).getInputStream();

FirebaseOptions options = FirebaseOptions.builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
Expand Down

0 comments on commit 4d59040

Please sign in to comment.