You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (input.urlWithLinkCode !== undefined && input.userInputCode !== undefined) {
139
-
message = `Enter OTP: ${input.userInputCode} OR click this link: ${input.urlWithLinkCode} to login`;
140
-
} else if (input.urlWithLinkCode !== undefined) {
141
-
message = `Click this link: ${input.urlWithLinkCode} to login`;
142
-
} else {
143
-
message = `Enter OTP: ${input.userInputCode} to login`;
144
-
}
145
-
message += ` It will expire in ${input.codeLifetime} seconds.`;
146
-
console.log(input.urlWithLinkCode)
147
-
await twilio.messages.create({
148
-
body: message,
149
-
to: input.phoneNumber,
150
-
from: twilioPhoneNumber
151
-
});
152
-
*/
153
-
try{
154
-
awaitaxios({
155
-
method: "post",
156
-
baseURL: "https://api.supertokens.com",
157
-
url: "/0/st/twilio/message",
158
-
headers: {
159
-
"api-version": "0",
160
-
},
161
-
data: {
162
-
to: input.phoneNumber,
163
-
appName: APP_NAME,
164
-
codeLifetime: Math.ceil(input.codeLifetime/1000),
165
-
urlWithLinkCode: input.urlWithLinkCode,
166
-
userInputCode: input.userInputCode,
167
-
},
168
-
});
169
-
}catch(err){
170
-
if(err.response.status!==429){
171
-
throwerr;
172
-
}
173
-
throwError(
174
-
"Too many requests made for passwordless sign-in/up with phone number. The number of requests are restricted for this demo app. Please try again after 24 hours."
109
+
if(input.urlWithLinkCode!==undefined){
110
+
/**
111
+
* Electron uses file protocol for production builds. SuperTokens does not currently support
112
+
* file protocol URLs, as a workaround we add a `/auth/verify` route that redirects to the
113
+
* eletron app using deeplinking.
114
+
*
115
+
* Here we modify the magic link to use the apiDomain instead of the websiteDomain
0 commit comments