আপনি ফায়ারবেস অথেনটিকেশন ব্যবহার করে কোনো ব্যবহারকারীকে একটি লিঙ্কসহ ইমেল পাঠিয়ে সাইন ইন করাতে পারেন, যেখানে ক্লিক করে তিনি সাইন ইন করতে পারবেন। এই প্রক্রিয়ায় ব্যবহারকারীর ইমেল অ্যাড্রেসটিও যাচাই করা হয়।
ইমেইলের মাধ্যমে সাইন ইন করার অনেক সুবিধা রয়েছে:
- সহজ সাইন-আপ এবং সাইন-ইন।
- বিভিন্ন অ্যাপ্লিকেশনে পাসওয়ার্ড পুনরায় ব্যবহারের ঝুঁকি কমে যায়, যা এমনকি ভালোভাবে নির্বাচিত পাসওয়ার্ডের নিরাপত্তাকেও দুর্বল করে দিতে পারে।
- কোনো ব্যবহারকারীকে প্রমাণীকরণের পাশাপাশি তিনি যে একটি ইমেইল ঠিকানার বৈধ মালিক, তা যাচাই করার ক্ষমতা।
- সাইন ইন করার জন্য ব্যবহারকারীর শুধুমাত্র একটি অ্যাক্সেসযোগ্য ইমেল অ্যাকাউন্ট প্রয়োজন। কোনো ফোন নম্বর বা সোশ্যাল মিডিয়া অ্যাকাউন্টের মালিকানার প্রয়োজন নেই।
- ব্যবহারকারী পাসওয়ার্ড দেওয়া (বা মনে রাখার) প্রয়োজন ছাড়াই নিরাপদে সাইন ইন করতে পারেন, যা মোবাইল ডিভাইসে বেশ ঝামেলার হতে পারে।
- একজন বিদ্যমান ব্যবহারকারী যিনি পূর্বে ইমেল আইডেন্টিফায়ার (পাসওয়ার্ড বা ফেডারেটেড) দিয়ে সাইন ইন করতেন, তাকে শুধুমাত্র ইমেল দিয়ে সাইন ইন করার জন্য আপগ্রেড করা যেতে পারে। উদাহরণস্বরূপ, একজন ব্যবহারকারী যিনি তার পাসওয়ার্ড ভুলে গেছেন, তিনি পাসওয়ার্ড রিসেট করার প্রয়োজন ছাড়াই সাইন ইন করতে পারবেন।
শুরু করার আগে
যদি আপনি ইতিমধ্যেই তা না করে থাকেন, তাহলে "আপনার জাভাস্ক্রিপ্ট প্রকল্পে ফায়ারবেস যুক্ত করুন" অংশে বর্ণিত পদ্ধতি অনুসারে Firebase কনসোল থেকে ইনিশিয়ালাইজেশন কোডটি আপনার প্রকল্পে কপি করুন।
আপনার Firebase প্রোজেক্টের জন্য ইমেল লিঙ্ক সাইন-ইন সক্রিয় করুন।
ইমেল লিঙ্কের মাধ্যমে ব্যবহারকারীদের সাইন ইন করাতে হলে, আপনাকে প্রথমে আপনার Firebase প্রোজেক্টের জন্য ইমেল প্রোভাইডার এবং ইমেল লিঙ্ক সাইন-ইন পদ্ধতিটি সক্রিয় করতে হবে:
Firebase কনসোলে, Security > Authentication- এ যান।
সাইন-ইন পদ্ধতি ট্যাবে, ইমেল/পাসওয়ার্ড সাইন-ইন পদ্ধতিটি সক্রিয় করুন। মনে রাখবেন, ইমেল লিঙ্ক সাইন-ইন ব্যবহার করার জন্য ইমেল/পাসওয়ার্ড সাইন-ইন অবশ্যই সক্রিয় থাকতে হবে।
একই বিভাগে, ইমেল লিঙ্ক (পাসওয়ার্ডবিহীন সাইন-ইন) সাইন-ইন প্রদানকারীকে সক্রিয় করুন।
সংরক্ষণ করুন- এ ক্লিক করুন।
ব্যবহারকারীর ইমেল ঠিকানায় একটি প্রমাণীকরণ লিঙ্ক পাঠান।
প্রমাণীকরণ প্রক্রিয়া শুরু করতে, ব্যবহারকারীকে এমন একটি ইন্টারফেস দেখান যেখানে তার ইমেল ঠিকানা দিতে বলা হবে এবং তারপর Firebase-কে ব্যবহারকারীর ইমেলে প্রমাণীকরণ লিঙ্কটি পাঠানোর অনুরোধ জানাতে sendSignInLinkToEmail কল করুন।
ActionCodeSettingsঅবজেক্টটি তৈরি করুন, যা ফায়ারবেসকে ইমেল লিঙ্কটি কীভাবে তৈরি করতে হবে সে সম্পর্কে নির্দেশনা প্রদান করে। নিম্নলিখিত ফিল্ডগুলি সেট করুন:url: এমবেড করার জন্য ডিপ লিঙ্ক এবং সাথে পাঠানোর জন্য যেকোনো অতিরিক্ত স্টেট। যদি আগে থেকে না করে থাকেন, তাহলে আপনার ডোমেইনটি অনুমোদিত ডোমেইনের তালিকায় যোগ করুন:Firebase কনসোলে, Security > Authentication > Settings ট্যাবে যান।
অনুমোদিত ডোমেইন বিভাগে, 'ডোমেইন যোগ করুন'- এ ক্লিক করুন এবং আপনার ডোমেইনটি যোগ করুন।
-
androidএবংios: Firebase Authentication এটি নির্ধারণ করতে সাহায্য করে যে, এটি একটি শুধুমাত্র-ওয়েব লিঙ্ক তৈরি করবে নাকি একটি মোবাইল লিঙ্ক তৈরি করবে যা অ্যান্ড্রয়েড বা অ্যাপল ডিভাইসে খোলা হবে। -
handleCodeInApp: এটিকে true-তে সেট করুন। অন্যান্য আউট-অফ-ব্যান্ড ইমেল অ্যাকশনের (যেমন পাসওয়ার্ড রিসেট এবং ইমেল ভেরিফিকেশন) মতো নয়, সাইন-ইন অপারেশনটি সবসময় অ্যাপের মধ্যেই সম্পন্ন করতে হবে। এর কারণ হলো, ফ্লো-এর শেষে ব্যবহারকারীকে সাইন-ইন করা অবস্থায় এবং তার অথেন্টিকেশন স্টেট অ্যাপের মধ্যেই সংরক্ষিত থাকার কথা। -
linkDomain: যখন কোনো প্রোজেক্টের জন্য কাস্টম Hosting লিঙ্ক ডোমেইন নির্ধারণ করা হয়, তখন নির্দিষ্ট মোবাইল অ্যাপ দ্বারা লিঙ্কটি খোলার জন্য কোনটি ব্যবহার করা হবে তা নির্দিষ্ট করুন। অন্যথায়, ডিফল্ট ডোমেইন স্বয়ংক্রিয়ভাবে নির্বাচিত হয় (উদাহরণস্বরূপ,PROJECT_ID .firebaseapp.com) dynamicLinkDomain: অপ্রচলিত। এই প্যারামিটারটি উল্লেখ করবেন না।Web
const actionCodeSettings = { // URL you want to redirect back to. The domain (www.example.com) for this // URL must be in the authorized domains list in the Firebase Console. url: 'https://www.example.com/finishSignUp?cartId=1234', // This must be true. handleCodeInApp: true, iOS: { bundleId: 'com.example.ios' }, android: { packageName: 'com.example.android', installApp: true, minimumVersion: '12' }, // The domain must be configured in Firebase Hosting and owned by the project. linkDomain: 'custom-domain.com' };
Web
var actionCodeSettings = { // URL you want to redirect back to. The domain (www.example.com) for this // URL must be in the authorized domains list in the Firebase Console. url: 'https://www.example.com/finishSignUp?cartId=1234', // This must be true. handleCodeInApp: true, iOS: { bundleId: 'com.example.ios' }, android: { packageName: 'com.example.android', installApp: true, minimumVersion: '12' }, dynamicLinkDomain: 'example.page.link' };
ActionCodeSettingsসম্পর্কে আরও জানতে, "ইমেল অ্যাকশনে স্টেট পাস করা" বিভাগটি দেখুন।ব্যবহারকারীর ইমেইল ঠিকানা জিজ্ঞাসা করুন।
ব্যবহারকারীর ইমেইলে প্রমাণীকরণ লিঙ্কটি পাঠান এবং তার ইমেইলটি সংরক্ষণ করুন, যাতে ব্যবহারকারী একই ডিভাইসে ইমেইল সাইন-ইন সম্পন্ন করলে তা কাজে লাগে।
Web
import { getAuth, sendSignInLinkToEmail } from "firebase/auth"; const auth = getAuth(); sendSignInLinkToEmail(auth, email, actionCodeSettings) .then(() => { // The link was successfully sent. Inform the user. // Save the email locally so you don't need to ask the user for it again // if they open the link on the same device. window.localStorage.setItem('emailForSignIn', email); // ... }) .catch((error) => { const errorCode = error.code; const errorMessage = error.message; // ... });
Web
firebase.auth().sendSignInLinkToEmail(email, actionCodeSettings) .then(() => { // The link was successfully sent. Inform the user. // Save the email locally so you don't need to ask the user for it again // if they open the link on the same device. window.localStorage.setItem('emailForSignIn', email); // ... }) .catch((error) => { var errorCode = error.code; var errorMessage = error.message; // ... });
ইমেল লিঙ্কের মাধ্যমে সাইন ইন সম্পন্ন করুন।
নিরাপত্তা উদ্বেগ
অনাকাঙ্ক্ষিত ব্যবহারকারী বা অনাকাঙ্ক্ষিত ডিভাইসে সাইন-ইন করার জন্য সাইন-ইন লিঙ্কটি যাতে ব্যবহার করা না যায়, সেজন্য সাইন-ইন প্রক্রিয়া সম্পন্ন করার সময় Firebase Auth-এর জন্য ব্যবহারকারীর ইমেল ঠিকানা প্রদান করা আবশ্যক। সাইন-ইন সফল হওয়ার জন্য, এই ইমেল ঠিকানাটি অবশ্যই সেই ঠিকানার সাথে মিলতে হবে যেখানে সাইন-ইন লিঙ্কটি মূলত পাঠানো হয়েছিল।
যেসব ব্যবহারকারী যে ডিভাইসে সাইন-ইন লিঙ্কের জন্য অনুরোধ করেন, সেই একই ডিভাইসে লিঙ্কটি খোলেন, তাদের জন্য এই প্রক্রিয়াটিকে আরও সহজ করতে, সাইন-ইন ইমেল পাঠানোর সময় তাদের ইমেল ঠিকানা স্থানীয়ভাবে সংরক্ষণ করুন—উদাহরণস্বরূপ, লোকালস্টোরেজ বা কুকিজ ব্যবহার করে। তারপর, প্রক্রিয়াটি সম্পূর্ণ করতে এই ঠিকানাটি ব্যবহার করুন। রিডাইরেক্ট ইউআরএল প্যারামিটারে ব্যবহারকারীর ইমেল পাঠাবেন না এবং এটি পুনরায় ব্যবহার করবেন না, কারণ এটি সেশন ইনজেকশনের সুযোগ করে দিতে পারে।
সাইন-ইন সম্পন্ন হওয়ার পর, ব্যবহারকারীর পূর্ববর্তী যেকোনো যাচাইবিহীন সাইন-ইন পদ্ধতি মুছে ফেলা হবে এবং বিদ্যমান সেশনগুলো বাতিল হয়ে যাবে। উদাহরণস্বরূপ, যদি কেউ পূর্বে একই ইমেল এবং পাসওয়ার্ড দিয়ে একটি যাচাইবিহীন অ্যাকাউন্ট তৈরি করে থাকে, তবে ব্যবহারকারীর পাসওয়ার্ডটি মুছে ফেলা হবে, যাতে সেই ছদ্মবেশী ব্যক্তি, যিনি মালিকানা দাবি করে অ্যাকাউন্টটি তৈরি করেছিলেন, তিনি পুনরায় সেই যাচাইবিহীন ইমেল এবং পাসওয়ার্ড দিয়ে সাইন-ইন করতে না পারেন।
এছাড়াও, মধ্যবর্তী সার্ভার দ্বারা আপনার লিঙ্কটি সম্ভাব্যভাবে হস্তগত হওয়া এড়াতে প্রোডাকশনে একটি HTTPS URL ব্যবহার করা নিশ্চিত করুন।
একটি ওয়েব পেজে সাইন-ইন সম্পন্ন করা
ইমেল লিঙ্ক ডিপ লিঙ্কের ফরম্যাটটি আউট-অফ-ব্যান্ড ইমেল অ্যাকশন (ইমেল ভেরিফিকেশন, পাসওয়ার্ড রিসেট এবং ইমেল পরিবর্তন প্রত্যাহার)-এর জন্য ব্যবহৃত ফরম্যাটের মতোই। Firebase Auth এই যাচাই প্রক্রিয়াটিকে সহজ করে তোলে isSignInWithEmailLink API প্রদানের মাধ্যমে, যা দিয়ে যাচাই করা যায় যে লিঙ্কটি ইমেলের মাধ্যমে সাইন-ইন করার লিঙ্ক কি না।
ল্যান্ডিং পেজে সাইন ইন সম্পন্ন করতে, ব্যবহারকারীর ইমেল এবং ওয়ান-টাইম কোড সম্বলিত আসল ইমেল লিঙ্কটি দিয়ে signInWithEmailLink কল করুন।
Web
import { getAuth, isSignInWithEmailLink, signInWithEmailLink } from "firebase/auth"; // Confirm the link is a sign-in with email link. const auth = getAuth(); if (isSignInWithEmailLink(auth, window.location.href)) { // Additional state parameters can also be passed via URL. // This can be used to continue the user's intended action before triggering // the sign-in operation. // Get the email if available. This should be available if the user completes // the flow on the same device where they started it. let email = window.localStorage.getItem('emailForSignIn'); if (!email) { // User opened the link on a different device. To prevent session fixation // attacks, ask the user to provide the associated email again. For example: email = window.prompt('Please provide your email for confirmation'); } // The client SDK will parse the code from the link for you. signInWithEmailLink(auth, email, window.location.href) .then((result) => { // Clear email from storage. window.localStorage.removeItem('emailForSignIn'); // You can access the new user by importing getAdditionalUserInfo // and calling it with result: // getAdditionalUserInfo(result) // You can access the user's profile via: // getAdditionalUserInfo(result)?.profile // You can check if the user is new or existing: // getAdditionalUserInfo(result)?.isNewUser }) .catch((error) => { // Some error occurred, you can inspect the code: error.code // Common errors could be invalid email and invalid or expired OTPs. }); }
Web
// Confirm the link is a sign-in with email link. if (firebase.auth().isSignInWithEmailLink(window.location.href)) { // Additional state parameters can also be passed via URL. // This can be used to continue the user's intended action before triggering // the sign-in operation. // Get the email if available. This should be available if the user completes // the flow on the same device where they started it. var email = window.localStorage.getItem('emailForSignIn'); if (!email) { // User opened the link on a different device. To prevent session fixation // attacks, ask the user to provide the associated email again. For example: email = window.prompt('Please provide your email for confirmation'); } // The client SDK will parse the code from the link for you. firebase.auth().signInWithEmailLink(email, window.location.href) .then((result) => { // Clear email from storage. window.localStorage.removeItem('emailForSignIn'); // You can access the new user via result.user // Additional user info profile not available via: // result.additionalUserInfo.profile == null // You can check if the user is new or existing: // result.additionalUserInfo.isNewUser }) .catch((error) => { // Some error occurred, you can inspect the code: error.code // Common errors could be invalid email and invalid or expired OTPs. }); }
মোবাইল অ্যাপে সাইন-ইন সম্পন্ন করা
Firebase Authentication একটি মোবাইল ডিভাইসে ইমেল লিঙ্ক পাঠাতে Firebase Hosting ব্যবহার করে। মোবাইল অ্যাপ্লিকেশনের মাধ্যমে সাইন-ইন সম্পন্ন করার জন্য, অ্যাপ্লিকেশনটিকে আগত অ্যাপ্লিকেশন লিঙ্কটি শনাক্ত করতে, অন্তর্নিহিত ডিপ লিঙ্কটি পার্স করতে এবং তারপরে ওয়েব ফ্লো-এর মতোই সাইন-ইন সম্পন্ন করার জন্য কনফিগার করতে হবে।
একটি অ্যান্ড্রয়েড অ্যাপ্লিকেশনে ইমেল লিঙ্কের মাধ্যমে সাইন-ইন কীভাবে পরিচালনা করতে হয় সে সম্পর্কে আরও জানতে, অ্যান্ড্রয়েড গাইডটি দেখুন।
একটি অ্যাপল অ্যাপ্লিকেশনে ইমেল লিঙ্কের মাধ্যমে সাইন-ইন কীভাবে পরিচালনা করতে হয় সে সম্পর্কে আরও জানতে, অ্যাপল প্ল্যাটফর্ম গাইডটি দেখুন।
ইমেল লিঙ্কের মাধ্যমে সংযোগ/পুনঃপ্রমাণীকরণ
আপনি এই প্রমাণীকরণ পদ্ধতিটি কোনো বিদ্যমান ব্যবহারকারীর সাথেও লিঙ্ক করতে পারেন। উদাহরণস্বরূপ, যে ব্যবহারকারী পূর্বে অন্য কোনো প্রদানকারী, যেমন একটি ফোন নম্বর, ব্যবহার করে প্রমাণীকৃত হয়েছেন, তিনি তার বিদ্যমান অ্যাকাউন্টে এই সাইন-ইন পদ্ধতিটি যোগ করতে পারেন।
পার্থক্যটা হবে অপারেশনটির দ্বিতীয়ার্ধে:
Web
import { getAuth, linkWithCredential, EmailAuthProvider } from "firebase/auth"; // Construct the email link credential from the current URL. const credential = EmailAuthProvider.credentialWithLink( email, window.location.href); // Link the credential to the current user. const auth = getAuth(); linkWithCredential(auth.currentUser, credential) .then((usercred) => { // The provider is now successfully linked. // The phone user can now sign in with their phone number or email. }) .catch((error) => { // Some error occurred. });
Web
// Construct the email link credential from the current URL. var credential = firebase.auth.EmailAuthProvider.credentialWithLink( email, window.location.href); // Link the credential to the current user. firebase.auth().currentUser.linkWithCredential(credential) .then((usercred) => { // The provider is now successfully linked. // The phone user can now sign in with their phone number or email. }) .catch((error) => { // Some error occurred. });
কোনো সংবেদনশীল কার্যক্রম চালানোর আগে ইমেল লিঙ্কের ব্যবহারকারীকে পুনরায় প্রমাণীকরণের জন্যও এটি ব্যবহার করা যেতে পারে।
Web
import { getAuth, reauthenticateWithCredential, EmailAuthProvider } from "firebase/auth"; // Construct the email link credential from the current URL. const credential = EmailAuthProvider.credentialWithLink( email, window.location.href); // Re-authenticate the user with this credential. const auth = getAuth(); reauthenticateWithCredential(auth.currentUser, credential) .then((usercred) => { // The user is now successfully re-authenticated and can execute sensitive // operations. }) .catch((error) => { // Some error occurred. });
Web
// Construct the email link credential from the current URL. var credential = firebase.auth.EmailAuthProvider.credentialWithLink( email, window.location.href); // Re-authenticate the user with this credential. firebase.auth().currentUser.reauthenticateWithCredential(credential) .then((usercred) => { // The user is now successfully re-authenticated and can execute sensitive // operations. }) .catch((error) => { // Some error occurred. });
তবে, যেহেতু প্রক্রিয়াটি এমন কোনো ভিন্ন ডিভাইসে শেষ হতে পারে যেখানে মূল ব্যবহারকারী লগ ইন করা ছিলেন না, তাই এই প্রক্রিয়াটি সম্পূর্ণ নাও হতে পারে। সেক্ষেত্রে, ব্যবহারকারীকে একই ডিভাইসে লিঙ্কটি খুলতে বাধ্য করার জন্য একটি ত্রুটি দেখানো যেতে পারে। অপারেশনের ধরন এবং ব্যবহারকারীর ইউআইডি (uid) সম্পর্কে তথ্য প্রদানের জন্য লিঙ্কে কিছু স্টেট (state) পাঠানো যেতে পারে।
অপ্রচলিত: ইমেল-পাসওয়ার্ড এবং ইমেল লিঙ্কের মধ্যে পার্থক্য করা
যদি আপনি আপনার প্রজেক্টটি ১৫ই সেপ্টেম্বর, ২০২৩ বা তার পরে তৈরি করে থাকেন, তাহলে ইমেইল এনুমারেশন প্রোটেকশন ডিফল্টরূপে সক্রিয় থাকে। এই ফিচারটি আপনার প্রজেক্টের ইউজার অ্যাকাউন্টগুলোর নিরাপত্তা উন্নত করে, কিন্তু এটি fetchSignInMethodsForEmail() মেথডটিকে নিষ্ক্রিয় করে দেয়, যা আমরা পূর্বে আইডেন্টিফায়ার-ফার্স্ট ফ্লো বাস্তবায়নের জন্য সুপারিশ করেছিলাম।
যদিও আপনি আপনার প্রোজেক্টের জন্য ইমেল গণনা সুরক্ষা নিষ্ক্রিয় করতে পারেন, আমরা তা না করার পরামর্শ দিই।
আরও বিস্তারিত তথ্যের জন্য ইমেল গণনা সুরক্ষা সংক্রান্ত ডকুমেন্টেশন দেখুন।
লিঙ্ক সাইন-ইন এর জন্য ডিফল্ট ইমেল টেমপ্লেট
ডিফল্ট ইমেল টেমপ্লেটে সাবজেক্ট এবং ইমেলের মূল অংশে একটি টাইমস্ট্যাম্প অন্তর্ভুক্ত থাকে, যাতে পরবর্তী ইমেলগুলো একটিমাত্র থ্রেডে মিশে না যায় এবং লিঙ্কটি লুকানো না পড়ে ।
এই টেমপ্লেটটি নিম্নলিখিত ভাষাগুলোর জন্য প্রযোজ্য:
| কোড | ভাষা |
|---|---|
| আর | আরবি |
| zh-CN | চীনা (সরলীকৃত) |
| zh-TW | চীনা (ঐতিহ্যবাহী) |
| এনএল | ডাচ |
| ইংরেজি | ইংরেজি |
| ইংরেজি-জিবি | ইংরেজি (যুক্তরাজ্য) |
| ফ্র | ফরাসি |
| ডি | জার্মান |
| আইডি | ইন্দোনেশিয়ান |
| এটা | ইতালীয় |
| জা | জাপানি |
| কো | কোরিয়ান |
| পিএল | পোলিশ |
| পিটি-বিআর | পর্তুগিজ (ব্রাজিল) |
| পিটি-পিটি | পর্তুগিজ (পর্তুগাল) |
| রু | রাশিয়ান |
| ইএস | স্প্যানিশ |
| ইএস-৪১৯ | স্প্যানিশ (লাতিন আমেরিকা) |
| তম | থাই |
পরবর্তী পদক্ষেপ
কোনো ব্যবহারকারী প্রথমবার সাইন ইন করার পর, একটি নতুন ব্যবহারকারী অ্যাকাউন্ট তৈরি হয় এবং সেটি ব্যবহারকারীর সাইন ইন করার ক্রেডেনশিয়াল—অর্থাৎ, ইউজার নেম ও পাসওয়ার্ড, ফোন নম্বর, বা অথোরাইজেশন প্রোভাইডারের তথ্যের—সাথে লিঙ্ক করা হয়। এই নতুন অ্যাকাউন্টটি আপনার ফায়ারবেস প্রজেক্টের অংশ হিসেবে সংরক্ষিত থাকে এবং ব্যবহারকারী কীভাবে সাইন ইন করছেন তা নির্বিশেষে, আপনার প্রজেক্টের প্রতিটি অ্যাপে তাকে শনাক্ত করতে এটি ব্যবহার করা যেতে পারে।
আপনার অ্যাপগুলিতে, ব্যবহারকারীর অথেন্টিকেশন স্ট্যাটাস জানার জন্য প্রস্তাবিত উপায় হলো
Authঅবজেক্টে একটি অবজারভার সেট করা। এরপর আপনিUserঅবজেক্ট থেকে ব্যবহারকারীর প্রাথমিক প্রোফাইল তথ্য পেতে পারেন। ব্যবহারকারী ব্যবস্থাপনা (Manage Users) দেখুন।আপনার Firebase Realtime Database and Cloud Storage Security Rules- এ, আপনি
authভেরিয়েবল থেকে সাইন-ইন করা ব্যবহারকারীর অনন্য ইউজার আইডি পেতে পারেন এবং একজন ব্যবহারকারী কোন ডেটা অ্যাক্সেস করতে পারবে তা নিয়ন্ত্রণ করতে এটি ব্যবহার করতে পারেন।
কোনো ব্যবহারকারীকে সাইন আউট করতে, signOut কল করুন:
Web
import { getAuth, signOut } from "firebase/auth"; const auth = getAuth(); signOut(auth).then(() => { // Sign-out successful. }).catch((error) => { // An error happened. });
Web
firebase.auth().signOut().then(() => { // Sign-out successful. }).catch((error) => { // An error happened. });