MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / login

Function login

apps/testbed/src/App.tsx:50–62  ·  view source on GitHub ↗
(u: User)

Source from the content-addressed store, hash-verified

48 }
49
50 function login(u: User) {
51 localStorage.setItem('op_testbed_user', JSON.stringify(u));
52 setUser(u);
53 op.identify({
54 profileId: u.id,
55 firstName: u.firstName,
56 lastName: u.lastName,
57 email: u.email,
58 });
59 applyGroups(u);
60 op.track('user_login', { method: 'form', group_count: u.groupIds.length });
61 navigate('/');
62 }
63
64 function logout() {
65 localStorage.removeItem('op_testbed_user');

Callers

nothing calls this directly

Calls 5

applyGroupsFunction · 0.85
setItemMethod · 0.80
stringifyMethod · 0.45
identifyMethod · 0.45
trackMethod · 0.45

Tested by

no test coverage detected