File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1515
1616use function Opis \Closure \init ;
1717use function Opis \Closure \serialize ;
18+ use function Opis \Closure \set_security_provider ;
1819use function Opis \Closure \unserialize ;
1920
2021/**
@@ -134,7 +135,7 @@ public function __unserialize($data): void
134135 }
135136
136137 /**
137- * Loads the secret key used by this library.
138+ * Loads (or reloads) the secret key used by this library.
138139 *
139140 * Normally, this function does not need to be called by linrary users.
140141 * @return void
@@ -143,9 +144,13 @@ public static function loadSecretKey(): void
143144 {
144145 // read from the env file for the secret key (if exists) to verify our identity
145146 $ secretKey = env ("PROCESS_ASYNC_SECRET_KEY " );
147+ init (null );
146148 if ($ secretKey != null && strlen ($ secretKey ) > 0 ) {
147149 // we can set the secret key
148- init ($ secretKey );
150+ set_security_provider ($ secretKey );
151+ } else {
152+ // no secret key given, clear the security
153+ set_security_provider (null );
149154 }
150155 }
151156
You can’t perform that action at this time.
0 commit comments