MCPcopy Create free account
hub / github.com/NativeScript/firebase / checkActionCode

Method checkActionCode

packages/firebase-auth/index.android.ts:1309–1351  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

1307 }
1308
1309 checkActionCode(code: string): Promise<ActionCodeInfo> {
1310 return new Promise((resolve, reject) => {
1311 if (!this.native) {
1312 reject();
1313 }
1314
1315 NSFirebaseAuth().checkActionCode(
1316 this.native,
1317 code,
1318 new org.nativescript.firebase.auth.FirebaseAuth.Callback({
1319 onSuccess(success) {
1320 const operation = toActionCodeOperation(success.getOperation());
1321 const actionCodeInfo: ActionCodeInfo = {
1322 data: {
1323 email: undefined,
1324 previousEmail: undefined,
1325 },
1326 operation,
1327 };
1328 const info = success.getInfo();
1329
1330 if (operation === ActionCodeInfoOperation.VerifyEmail || operation === ActionCodeInfoOperation.PasswordReset) {
1331 actionCodeInfo.data.email = info.getEmail();
1332 } else if (operation === ActionCodeInfoOperation.RevertSecondFactorAddition) {
1333 actionCodeInfo.data.email = null;
1334 actionCodeInfo.data.previousEmail = null;
1335 } else if (operation === ActionCodeInfoOperation.RecoverEmail || operation === ActionCodeInfoOperation.VerifyAndChangeEmail) {
1336 actionCodeInfo.data.email = (info as com.google.firebase.auth.ActionCodeEmailInfo).getEmail();
1337 actionCodeInfo.data.previousEmail = (info as com.google.firebase.auth.ActionCodeEmailInfo).getPreviousEmail();
1338 }
1339
1340 resolve(actionCodeInfo);
1341 },
1342 onError(error) {
1343 reject({
1344 message: error.getMessage(),
1345 native: error,
1346 });
1347 },
1348 })
1349 );
1350 });
1351 }
1352
1353 applyActionCode(code: string): Promise<void> {
1354 return new Promise((resolve, reject) => {

Callers

nothing calls this directly

Calls 1

checkActionCodeMethod · 0.65

Tested by

no test coverage detected