Skip to content

Commit f0badfb

Browse files
committed
fix(auth): correct null-safety in firebase authenticator
Adds a null-assertion operator to `firebasePrivateKey` within the `FirebaseAuthenticator`. This is safe as the authenticator is only created when all Firebase credentials are confirmed to be non-null, resolving the compile-time error.
1 parent 7ec5e75 commit f0badfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/services/firebase_authenticator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class FirebaseAuthenticator implements IFirebaseAuthenticator {
3232
_log.info('Requesting new Firebase access token...');
3333
try {
3434
// Step 1: Create and sign the JWT.
35-
final pem = EnvironmentConfig.firebasePrivateKey.replaceAll(r'\n', '\n');
35+
final pem = EnvironmentConfig.firebasePrivateKey!.replaceAll(r'\n', '\n');
3636
final privateKey = RSAPrivateKey(pem);
3737
final jwt = JWT(
3838
{'scope': 'https://www.googleapis.com/auth/cloud-platform'},

0 commit comments

Comments
 (0)