55 lines
2.1 KiB
JavaScript
55 lines
2.1 KiB
JavaScript
/*! firebase-admin v13.8.0 */
|
|
"use strict";
|
|
/*!
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.PhoneNumberVerification = void 0;
|
|
const token_verifier_1 = require("./token-verifier");
|
|
const phone_number_verification_api_client_internal_1 = require("./phone-number-verification-api-client-internal");
|
|
/**
|
|
* PhoneNumberVerification service bound to the provided app.
|
|
*/
|
|
class PhoneNumberVerification {
|
|
/**
|
|
* @param app - The app for this `PhoneNumberVerification` service.
|
|
* @constructor
|
|
* @internal
|
|
*/
|
|
constructor(app) {
|
|
this.appInternal = app;
|
|
this.phoneNumberVerificationVerifier = new token_verifier_1.PhoneNumberTokenVerifier(phone_number_verification_api_client_internal_1.JWKS_URL, 'https://fpnv.googleapis.com/projects/', phone_number_verification_api_client_internal_1.FPNV_TOKEN_INFO, app);
|
|
}
|
|
/**
|
|
* Returns the app associated with this `PhoneNumberVerification` instance.
|
|
*
|
|
* @returns The app associated with this `PhoneNumberVerification` instance.
|
|
*/
|
|
get app() {
|
|
return this.appInternal;
|
|
}
|
|
/**
|
|
* Verifies a Firebase Phone Number Verification token.
|
|
*
|
|
* @param jwt - A string containing the Firebase Phone Number Verification JWT.
|
|
* @returns A promise that resolves with the decoded token.
|
|
*/
|
|
verifyToken(jwt) {
|
|
return this.phoneNumberVerificationVerifier.verifyJWT(jwt);
|
|
}
|
|
}
|
|
exports.PhoneNumberVerification = PhoneNumberVerification;
|