MCPcopy
hub / github.com/loopbackio/loopback-next / getPrincipal

Method getPrincipal

packages/security/src/types.ts:186–195  ·  view source on GitHub ↗
(type: string)

Source from the content-addressed store, hash-verified

184 }
185
186 getPrincipal(type: string) {
187 let principal: Principal | undefined;
188 for (const p of this.principals) {
189 if (p.type === type) {
190 principal = p.principal;
191 break;
192 }
193 }
194 return principal;
195 }
196
197 get user() {
198 return this.getPrincipal('USER') as UserProfile | undefined;

Callers 2

userMethod · 0.95
subject.unit.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected