Skip to content

Commit

Permalink
fix: PostConstruct로 firebase 초기화
Browse files Browse the repository at this point in the history
  • Loading branch information
kimyu0218 committed Nov 5, 2024
1 parent 092816c commit c6fc30c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
Expand All @@ -18,6 +19,7 @@ public class FirebaseConfig {
@Value("${firebase.admin-sdk}")
private String encodedFirebaseAdminSdk;

@PostConstruct
public FirebaseApp firebaseApp() throws IOException {
byte[] decodedBytes = Base64.getDecoder().decode(encodedFirebaseAdminSdk);
ByteArrayInputStream adminSdk = new ByteArrayInputStream(decodedBytes);
Expand Down

0 comments on commit c6fc30c

Please sign in to comment.