* Reauthenticate. * @param context - The shared auth context.
(context: AuthContext)
| 64 | * @param context - The shared auth context. |
| 65 | */ |
| 66 | async reauth(context: AuthContext): Promise<void> { |
| 67 | if (context.reauthenticating) { |
| 68 | throw new MongoRuntimeError('Reauthentication already in progress.'); |
| 69 | } |
| 70 | try { |
| 71 | context.reauthenticating = true; |
| 72 | await this.auth(context); |
| 73 | } finally { |
| 74 | context.reauthenticating = false; |
| 75 | } |
| 76 | } |
| 77 | } |