()
| 29 | } |
| 30 | |
| 31 | async loadIdentity(): Promise<void> { |
| 32 | const authService = new AuthService(); |
| 33 | const identity = (await authService.identity()) ?? new AnonymousIdentity(); |
| 34 | |
| 35 | await this.init(); |
| 36 | |
| 37 | icAgent.get().replaceIdentity(identity); |
| 38 | if (identity.getPrincipal().isAnonymous()) { |
| 39 | logger.warn('Using anonymous identity, make sure to sign in'); |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | const icAgent = new IcAgent(); |