MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / onIntentReceiver

Method onIntentReceiver

src/lib/auth.js:73–90  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

71 }
72
73 async onIntentReceiver(event) {
74 try {
75 if (event?.module === "user" && event?.action === "login") {
76 if (event?.value) {
77 this.#exec("saveToken", [event.value]);
78 toast("Logged in successfully");
79
80 setTimeout(() => {
81 loginEvents.emit();
82 }, 500);
83 }
84 }
85 return null;
86 } catch (error) {
87 console.error("Failed to parse intent token.", error);
88 return null;
89 }
90 }
91
92 /**
93 * Helper to wrap cordova.exec in a Promise

Callers

nothing calls this directly

Calls 2

#execMethod · 0.95
errorMethod · 0.45

Tested by

no test coverage detected