<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sanjay Toge on Medium]]></title>
        <description><![CDATA[Stories by Sanjay Toge on Medium]]></description>
        <link>https://medium.com/@sanjaywebbverse?source=rss-227adf4e0e99------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*A1ctspaieItJi_ugwok4fw.png</url>
            <title>Stories by Sanjay Toge on Medium</title>
            <link>https://medium.com/@sanjaywebbverse?source=rss-227adf4e0e99------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 21:46:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanjaywebbverse/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stop Using Just One Link in Your Bio — Here’s a Smarter Way]]></title>
            <link>https://medium.com/@sanjaywebbverse/stop-using-just-one-link-in-your-bio-heres-a-smarter-way-9116f7b5e681?source=rss-227adf4e0e99------2</link>
            <guid isPermaLink="false">https://medium.com/p/9116f7b5e681</guid>
            <category><![CDATA[linktree-alternative]]></category>
            <category><![CDATA[linkinbio-tools]]></category>
            <dc:creator><![CDATA[Sanjay Toge]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 13:51:47 GMT</pubDate>
            <atom:updated>2026-03-17T13:51:47.159Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re a creator, freelancer, or small business owner, you’ve probably faced this problem:</p><p>👉 You only get <strong>one link in your bio</strong><br>👉 But you have <strong>multiple things to share</strong></p><p>Your Instagram, YouTube, portfolio, products, offers — everything competes for that one tiny space.</p><p>So what do most people do?</p><p>They keep changing that one link… again and again.</p><p>And every time they do, they lose opportunities.</p><h3>The Real Problem With “One Link”</h3><p>Social platforms were not designed to help you showcase everything.</p><p>They limit you.</p><p>That means:</p><ul><li>You lose traffic</li><li>Your audience misses important links</li><li>Your growth slows down</li></ul><p>And in today’s creator economy, <strong>attention = money</strong></p><h3>The Traditional Solution (And Its Limits)</h3><p>Tools like Linktree became popular because they solved this exact problem.</p><p>They let you:</p><ul><li>Add multiple links</li><li>Share everything in one place</li></ul><p>But here’s the catch 👇</p><p>Most of these tools are:</p><ul><li>Static</li><li>Boring</li><li>Not optimized for engagement</li><li>The same for everyone</li></ul><p>Your page ends up looking like everyone else’s.</p><h3>Introducing a Smarter Approach</h3><p>What if your bio link could do more than just list links?</p><p>What if it could:</p><ul><li>Design itself</li><li>Optimize for clicks</li><li>Look unique to you</li><li>Adapt intelligently</li></ul><p>That’s where <strong>AI-powered bio pages</strong> come in.</p><h3>Meet BioDock</h3><p><strong>BioDock</strong> is an AI-powered link-in-bio platform that helps you create a beautiful, high-converting bio page in seconds.</p><p>Instead of manually building your page, BioDock:</p><ul><li>Generates layouts automatically</li><li>Organizes your links smartly</li><li>Creates a clean, modern design</li><li>Helps you present your identity better</li></ul><h3>Why This Matters</h3><p>In a world where everyone is competing for attention:</p><p>👉 The difference is not just <em>what you share</em><br>👉 It’s <em>how you present it</em></p><p>A well-designed bio page can:</p><ul><li>Increase clicks</li><li>Improve conversions</li><li>Make your profile look professional</li><li>Build trust instantly</li></ul><h3>Who Is It For?</h3><p>BioDock is built for:</p><ul><li>Creators</li><li>Influencers</li><li>Freelancers</li><li>Startups</li><li>Anyone who shares links online</li></ul><p>If you have more than one thing to share (and you do), you need this.</p><h3>What Makes BioDock Different?</h3><p>Here’s where it stands out:</p><h3>1. AI-Powered Setup</h3><p>No design skills needed. Your page is created in seconds.</p><h3>2. Clean, Modern Design</h3><p>Not cluttered. Not generic. Built for today’s audience.</p><h3>3. Built for Engagement</h3><p>Every element is designed to help you get more clicks.</p><h3>4. Simple &amp; Fast</h3><p>No complicated setup. No learning curve.</p><h3>The Future of “Link in Bio”</h3><p>We’re moving from:<br>👉 Static link lists<br>to<br>👉 Smart, dynamic bio pages</p><p>And early adopters always win.</p><h3>Try It Yourself</h3><p>If you’re serious about growing your audience and making the most out of your bio:</p><p>👉 Visit: <a href="https://biodock.app/"><strong>https://biodock.app</strong></a></p><p>Create your bio page in seconds and see the difference yourself.</p><h3>Final Thought</h3><p>You don’t need more links.</p><p>You need a <strong>better way to present them</strong>.</p><p>And that’s exactly what BioDock is built for.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9116f7b5e681" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase Authentication with Angular]]></title>
            <link>https://medium.com/@sanjaywebbverse/firebase-authentication-with-angular-2235783956f7?source=rss-227adf4e0e99------2</link>
            <guid isPermaLink="false">https://medium.com/p/2235783956f7</guid>
            <category><![CDATA[firebaseauthentication]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Sanjay Toge]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 17:52:18 GMT</pubDate>
            <atom:updated>2023-04-04T18:20:11.021Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Authentication with Firebase and Angular</strong></h3><p>Let us dive deep in Authenticating our app with Firebase.</p><p>Versions:</p><pre>Angular CLI: 15.1.6<br>Node: 18.12.1<br>Package Manager: npm 9.5.0</pre><h3><strong>Introduction</strong></h3><p>To authenticate users for our project, Firebase offers backend services, simple SDKs, and ready-to-use UI libraries.</p><p>Providers</p><p>Passwords, phone numbers, well-known federated identity providers like Google, Facebook, and Twitter, among other methods, are all supported for authentication by Firebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pvJwUxmDUW6RsXtaCX6U8g.png" /><figcaption>Providers From Firebase</figcaption></figure><h3><strong>npm Packages</strong></h3><p>Note : Skip these steps if you want to add Firebase authentication to your existing Angular app</p><p><strong>Creating Angular from Scratch</strong></p><p>Make sure Node JS is installed on your local development machine before continuing.</p><p>Install Angular CLI;</p><p>disregard if previously done so.</p><pre>npm install -g angular/cli</pre><p><strong>Creating angular app</strong></p><pre>ng new angular-firebase-authentication</pre><p>Once the packages are downloaded and ready to use, get into the directory.</p><p>Then we will add Prime NG library to enhance our UI design.</p><pre>npm install primeng primeicons</pre><p>Add these css files to your angular.json file under “styles”</p><pre>&quot;styles&quot;: [<br>&quot;node_modules/primeicons/primeicons.css&quot;,<br>&quot;node_modules/primeng/resources/themes/lara-light-blue/theme.css&quot;,<br>&quot;node_modules/primeng/resources/primeng.min.css&quot;,<br>…<br></pre><h3><strong>Installing Firebase</strong></h3><p>To use Firebase in our app we will be using firebase and @angular/fire</p><p>Once the packages are installed we can add the firebase configurations in our <em>environment.ts</em> file or get details from vault as per the security of the app.</p><p>If you do not see any environments file/folder, this might be as Angular 15 simply doesn’t ship environment files by default anymore.</p><p>You can still generate those using the command</p><pre>ng generate environments</pre><p>To get the configuration details from your firebase account</p><p>Go to <a href="https://console.firebase.google.com/">https://console.firebase.google.com/</a> and once you have created your Project on Firebase console you can go to</p><p><strong>Project Overview &gt;&gt; Setting icon &gt;&gt; Project Settings</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*NkOk1-PXxYKqTeVlNfhCUg.png" /></figure><p>Once you are in project settings under General you can find your app which will have a SDK setup and configurations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B5u2a6iSuHeONrA8Q5Ajsw.png" /></figure><pre>firebaseConfig: {<br>        apiKey: &quot;xxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;,<br>        authDomain: &quot;app-name.firebaseapp.com&quot;,<br>        projectId: &quot;app-name&quot;,<br>        storageBucket: &quot;app-name.appspot.com&quot;,<br>        messagingSenderId: &quot;000000000000&quot;,<br>        appId: &quot;1:000000000000:web:012121212121212121&quot;,<br>        measurementId: &quot;G-XXXXXXXX&quot;<br>}</pre><p>Once you have imported the configurations in your environment file then we need to Import and register firebase modules in <em>app.module.ts.</em></p><pre>imports: [<br>    AngularFireModule.initializeApp(environment.firebaseConfig),<br>    AngularFireAuthModule,<br>    AngularFirestoreModule,<br>    AngularFireStorageModule,<br>    AngularFireDatabaseModule,<br>]</pre><h3><strong>Create Components and Routes</strong></h3><p>Once you have imported and initialized the firebase module, let us create some components, routes and Authentication service.</p><p>To generate components use the commands</p><pre>ng g c components/dashboard</pre><pre>ng g c components/sign-in</pre><pre>ng g c components/sign-up</pre><pre>ng g c components/forgot-password</pre><pre>ng g c components/verify-email</pre><p>And add the corresponding routes in your app.routing.module.ts or the specific module where you have created the components. It is better to use a separate module for authentication and authorization services, now for simplicity we will add the routes in our <em>app.routing.module.ts</em> file.</p><pre>const routes: Route = [<br>{ path: &#39;&#39;, redirectTo: &#39;/sign-in&#39;, pathMatch: &#39;full&#39; },<br>{ path: &#39;sign-in&#39;, component: SignInComponent },<br>{ path: &#39;register-user&#39;, component: SignUpComponent },<br>{ path: &#39;dashboard&#39;, component: DashboardComponent },<br>{ path: &#39;forgot-password&#39;, component: ForgotPasswordComponent },<br>{ path: &#39;verify-email-address&#39;, component: VerifyEmailComponent },<br>];</pre><h3><strong>Firebase Authentication Service</strong></h3><pre>ng g i shared/services/user</pre><pre>ng g s shared/services/auth</pre><p>To the User interface add the Object which is the users Schema</p><pre>export interface User {<br>    uid: string;<br>    email: string;<br>    displayName: string;<br>    photoURL: string;<br>    emailVerified: boolean;<br> }</pre><p>The created auth service holds the logic of our Authentication system, we will integrate Firebase’s Google Authentication, similarly other providers can be configured.</p><p>The auth service will take care of the canActivate auth guard mechanism for route protection as well as sign-in with username/password, sign-up with email/password, password reset, and email verification.</p><p>We now need to Inject Firestore service, Firebase auth service, NgZone to remove outside scope warnings</p><p>In the auth service configure these functions to sign in the user, signup, send the verification email, to reset the forgotten password, get user logged in status, Google auth, auth login to use providers, set users data, and sign out.</p><pre>import { Injectable, NgZone } from &#39;@angular/core&#39;;<br>import { AngularFireAuth } from &#39;@angular/fire/compat/auth&#39;;<br>import {<br>  AngularFirestore,<br>  AngularFirestoreDocument,<br>} from &#39;@angular/fire/compat/firestore&#39;;<br>import { Router } from &#39;@angular/router&#39;;<br>import { User } from &#39;./user&#39;;<br>import { GoogleAuthProvider } from &#39;firebase/auth&#39;;<br>@Injectable({<br>  providedIn: &#39;root&#39;,<br>})<br>export class AuthService {<br>  userData: User;<br>  constructor(<br>    public afAuth: AngularFireAuth,<br>    public afs: AngularFirestore,<br>    public ngZone: NgZone,<br>    public router: Router<br>  ) {<br>    /* Saving user data in localstorage when <br>    logged in and setting up null when logged out */<br>    this.afAuth.authState.subscribe((user) =&gt; {<br>      if (user) {<br>        this.userData = user;<br>        localStorage.setItem(&#39;user&#39;, JSON.stringify(this.userData));<br>        JSON.parse(localStorage.getItem(&#39;user&#39;)!);<br>      } else {<br>        localStorage.setItem(&#39;user&#39;, &#39;null&#39;);<br>        JSON.parse(localStorage.getItem(&#39;user&#39;)!);<br>      }<br>    });<br>  }<br>  // Sign in with email/password<br>  SignIn(email: string, password: string) {<br>    return this.afAuth<br>      .signInWithEmailAndPassword(email, password)<br>      .then((result) =&gt; {<br>        this.SetUserData(result.user);<br>        this.afAuth.authState.subscribe((user) =&gt; {<br>          if (user) {<br>            this.router.navigate([&#39;dashboard&#39;]);<br>          }<br>        });<br>      })<br>      .catch((error) =&gt; {<br>        window.alert(error.message);<br>      });<br>  }<br>  <br>  // Sign up with email/password<br>  SignUp(email: string, password: string) {<br>    return this.afAuth<br>      .createUserWithEmailAndPassword(email, password)<br>      .then((result) =&gt; {<br>        /* Call the SendVerificaitonMail() function when new user sign <br>        up and returns promise */<br>        this.SendVerificationMail();<br>        this.SetUserData(result.user);<br>      })<br>      .catch((error) =&gt; {<br>        window.alert(error.message);<br>      });<br>  }<br>  // Send email verfificaiton when new user sign up<br>  SendVerificationMail() {<br>    return this.afAuth.currentUser<br>      .then((u: any) =&gt; u.sendEmailVerification())<br>      .then(() =&gt; {<br>        this.router.navigate([&#39;verify-email-address&#39;]);<br>      });<br>  }<br>  // Reset Forggot password<br>  ForgotPassword(passwordResetEmail: string) {<br>    return this.afAuth<br>      .sendPasswordResetEmail(passwordResetEmail)<br>      .then(() =&gt; {<br>        window.alert(&#39;Password reset email sent, check your inbox.&#39;);<br>      })<br>      .catch((error) =&gt; {<br>        window.alert(error);<br>      });<br>  }<br>  // Returns true when user is looged in and email is verified<br>  get isLoggedIn(): boolean {<br>    const user = JSON.parse(localStorage.getItem(&#39;user&#39;)!);<br>    return user !== null &amp;&amp; user.emailVerified !== false ? true : false;<br>  }<br>  // Sign in with Google<br>  GoogleAuth() {<br>    return this.AuthLogin(new GoogleAuthProvider()).then((res: any) =&gt; {<br>      this.router.navigate([&#39;dashboard&#39;]);<br>    });<br>  }<br>  // Auth logic to run auth providers<br>  AuthLogin(provider: any) {<br>    return this.afAuth<br>      .signInWithPopup(provider)<br>      .then((result) =&gt; {<br>        this.router.navigate([&#39;dashboard&#39;]);<br>        this.SetUserData(result.user);<br>      })<br>      .catch((error) =&gt; {<br>        window.alert(error);<br>      });<br>  }<br>  /* Setting up user data when sign in with username/password, <br>  sign up with username/password and sign in with social auth  <br>  provider in Firestore database using AngularFirestore + AngularFirestoreDocument service */<br>  SetUserData(user: any) {<br>    const userRef: AngularFirestoreDocument&lt;any&gt; = this.afs.doc(<br>      `users/${user.uid}`<br>    );<br>    const userData: User = {<br>      uid: user.uid,<br>      email: user.email,<br>      displayName: user.displayName,<br>      photoURL: user.photoURL,<br>      emailVerified: user.emailVerified,<br>    };<br>    return userRef.set(userData, {<br>      merge: true,<br>    });<br>  }<br>  // Sign out<br>  SignOut() {<br>    return this.afAuth.signOut().then(() =&gt; {<br>      localStorage.removeItem(&#39;user&#39;);<br>      this.router.navigate([&#39;sign-in&#39;]);<br>    });<br>  }<br>}</pre><p>Once the code is added, go to your app.module.ts file and import authentication service so that it will be accessible throughout the application.</p><pre>providers:[<br>    AuthService<br>  ]</pre><h3><strong>Designing our Sign up and Login Page</strong></h3><p>Let us use our AuthService in the Login Component.</p><p>Add this code to your Login ts file, in this file we have implemented a function from our Authservice which takes email and password as the arguments</p><p><strong>Login</strong></p><pre>export class LoginComponent implements OnInit {<br>  loginForm: FormGroup;<br>  constructor(private router: Router, private authService: AuthService){<br>  }<br>  ngOnInit(): void {<br>    this.createLoginForm();<br>  }<br>  createLoginForm(){<br>    this.loginForm = new FormGroup({<br>      email: new FormControl(&#39;&#39;,Validators.required),<br>      password: new FormControl(&#39;&#39;,Validators.required)<br>    })<br>  }<br>  login(){<br>    if(this.loginForm.valid){<br>      this.authService.SignIn(this.loginForm.value.email, this.loginForm.value.password)<br>    }<br>  }<br>}</pre><p>Add this code in your HTML file</p><p>Here we have added the formgroup and the required fields</p><pre>&lt;form [formGroup]=&quot;loginForm&quot;&gt;<br>  &lt;div class=&quot;grid&quot;&gt;<br>    &lt;div class=&quot;col-12&quot;&gt;<br>      &lt;div class=&quot;card flex justify-content-center&quot;&gt;<br>        &lt;p-card header=&quot;Login&quot; [style]=&quot;{ width: &#39;360px&#39; }&quot;&gt;<br>          &lt;!-- &lt;ng-template pTemplate=&quot;header&quot;&gt;<br>           <br>          &lt;/ng-template&gt; --&gt;<br>          &lt;ng-template pTemplate=&quot;content&quot;&gt;<br>            &lt;div&gt;<br>              &lt;label for=&quot;username&quot;&gt;Email&lt;/label&gt;<br>              &lt;div&gt;<br>                &lt;input<br>                  class=&quot;w-100&quot;<br>                  pInputText<br>                  formControlName=&quot;email&quot;<br>                  type=&quot;text&quot;<br>                  placeholder=&quot;Email&quot;<br>                /&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;mt-3&quot;&gt;<br>              &lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;<br>              &lt;div&gt;<br>                &lt;input<br>                  class=&quot;w-100&quot;<br>                  pInputText<br>                  type=&quot;password&quot;<br>                  formControlName=&quot;password&quot;<br>                  placeholder=&quot;Password&quot;<br>                /&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/ng-template&gt;<br>          &lt;ng-template pTemplate=&quot;footer&quot;&gt;<br>            &lt;div class=&quot;flex justify-content-center align-items-center&quot;&gt;<br>              &lt;button pButton pRipple label=&quot;Log In&quot; (click)=&quot;login()&quot;&gt;&lt;/button&gt;<br>              &lt;p-button<br>                label=&quot;Forgot Password?&quot;<br>                styleClass=&quot;p-button-link&quot;<br>                routerLink=&quot;/reset-password&quot;<br>              &gt;&lt;/p-button&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;mt-2 flex justify-content-center align-items-center&quot;&gt;<br>              &lt;p-button<br>                label=&quot;Don&#39;t have an account?&quot;<br>                styleClass=&quot;p-button-link&quot;<br>                routerLink=&quot;/sign-up&quot;<br>              &gt;&lt;/p-button&gt;<br>            &lt;/div&gt;<br>          &lt;/ng-template&gt;<br>        &lt;/p-card&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/form&gt;</pre><p><strong>Sign Up</strong></p><p>Now to sign up a new user we will have to similarly inject the AuthService</p><p>We have added a signup function which call the sign up function from our auth service file.</p><pre>export class SignUpComponent implements OnInit {<br>  signupForm: FormGroup;<br>  constructor(private authService: AuthService) {}<br>  ngOnInit(): void {<br>    this.createForm();<br>  }<br>  createForm() {<br>    this.signupForm = new FormGroup({<br>      email: new FormControl(&#39;&#39;, Validators.required),<br>      password: new FormControl(&#39;&#39;, Validators.required),<br>      confirmPassword: new FormControl(&#39;&#39;, Validators.required),<br>      displayName: new FormControl(&#39;&#39;, Validators.required),<br>    });<br>  }<br>  signup() {<br>    if (this.signupForm.valid) {<br>      this.authService.SignUp(<br>        this.signupForm.value.email,<br>        this.signupForm.value.password<br>      );<br>    }<br>  }<br>}</pre><p>HTML code to show sign up form</p><pre>&lt;form [formGroup]=&quot;signupForm&quot;&gt;<br>  &lt;div class=&quot;grid&quot;&gt;<br>    &lt;div class=&quot;col-12&quot;&gt;<br>      &lt;div class=&quot;card flex justify-content-center&quot;&gt;<br>        &lt;p-card header=&quot;Sign up&quot; [style]=&quot;{ width: &#39;360px&#39; }&quot;&gt;<br>          &lt;!-- &lt;ng-template pTemplate=&quot;header&quot;&gt;<br>             <br>            &lt;/ng-template&gt; --&gt;<br>          &lt;ng-template pTemplate=&quot;content&quot;&gt;<br>            &lt;div&gt;<br>              &lt;label for=&quot;username&quot;&gt;Name&lt;/label&gt;<br>              &lt;div&gt;<br>                &lt;input<br>                  class=&quot;w-100&quot;<br>                  pInputText<br>                  formControlName=&quot;displayName&quot;<br>                  type=&quot;text&quot;<br>                  placeholder=&quot;Name&quot;<br>                /&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;mt-3&quot;&gt;<br>              &lt;label for=&quot;username&quot;&gt;Email&lt;/label&gt;<br>              &lt;div&gt;<br>                &lt;input<br>                  class=&quot;w-100&quot;<br>                  pInputText<br>                  formControlName=&quot;email&quot;<br>                  type=&quot;text&quot;<br>                  placeholder=&quot;Email&quot;<br>                /&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;mt-3&quot;&gt;<br>              &lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;<br>              &lt;div&gt;<br>                &lt;input<br>                  class=&quot;w-100&quot;<br>                  pInputText<br>                  type=&quot;password&quot;<br>                  formControlName=&quot;password&quot;<br>                  placeholder=&quot;Password&quot;<br>                /&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;mt-3&quot;&gt;<br>              &lt;label for=&quot;password&quot;&gt;Confirm Password&lt;/label&gt;<br>              &lt;div&gt;<br>                &lt;input<br>                  class=&quot;w-100&quot;<br>                  pInputText<br>                  type=&quot;password&quot;<br>                  formControlName=&quot;confirmPassword&quot;<br>                  placeholder=&quot;Confirm Password&quot;<br>                /&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/ng-template&gt;<br>          &lt;ng-template pTemplate=&quot;footer&quot;&gt;<br>            &lt;div class=&quot;flex justify-content-center align-items-center&quot;&gt;<br>              &lt;button<br>                pButton<br>                pRipple<br>                label=&quot;Sign up&quot;<br>                (click)=&quot;signup()&quot;<br>              &gt;&lt;/button&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;mt-2 flex justify-content-center align-items-center&quot;&gt;<br>              &lt;p-button<br>                label=&quot;Already have an account? Click Here&quot;<br>                styleClass=&quot;p-button-link&quot;<br>                routerLink=&quot;/login&quot;<br>              &gt;&lt;/p-button&gt;<br>            &lt;/div&gt;<br>          &lt;/ng-template&gt;<br>        &lt;/p-card&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/form&gt;</pre><h3>Reset Password</h3><p>To reset the password we need to send an email with a link so that the user only can reset the email link, this functionality is also already added in the auth service</p><pre>export class ResetPasswordComponent implements OnInit {<br>  resetForm: FormGroup;<br>  constructor(private authService: AuthService) {}<br>  ngOnInit(): void {<br>    this.resetForm = new FormGroup({<br>      email: new FormControl(&#39;&#39;, Validators.required),<br>    });<br>  }<br>  sendResetLink() {<br>    if (this.resetForm.valid) {<br>      this.authService.ForgotPassword(this.resetForm.value.email);<br>    }<br>  }<br>}</pre><p>UI to enter email to send the link to reset password</p><pre>&lt;form [formGroup]=&quot;resetForm&quot;&gt;<br>  &lt;div class=&quot;grid&quot;&gt;<br>    &lt;div class=&quot;col-12&quot;&gt;<br>      &lt;div class=&quot;card flex justify-content-center&quot;&gt;<br>        &lt;p-card header=&quot;Login&quot; [style]=&quot;{ width: &#39;360px&#39; }&quot;&gt;<br>          &lt;!-- &lt;ng-template pTemplate=&quot;header&quot;&gt;<br>             <br>            &lt;/ng-template&gt; --&gt;<br>          &lt;ng-template pTemplate=&quot;content&quot;&gt;<br>            &lt;div&gt;<br>              &lt;label for=&quot;username&quot;&gt;Email&lt;/label&gt;<br>              &lt;div&gt;<br>                &lt;input<br>                  class=&quot;w-100&quot;<br>                  pInputText<br>                  formControlName=&quot;email&quot;<br>                  type=&quot;text&quot;<br>                  placeholder=&quot;Email&quot;<br>                /&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/ng-template&gt;<br>          &lt;ng-template pTemplate=&quot;footer&quot;&gt;<br>            &lt;div class=&quot;flex justify-content-center align-items-center&quot;&gt;<br>              &lt;button<br>                pButton<br>                pRipple<br>                label=&quot;Reset Password&quot;<br>                (click)=&quot;sendResetLink()&quot;<br>              &gt;&lt;/button&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;mt-2 flex justify-content-center align-items-center&quot;&gt;<br>              &lt;p-button<br>                label=&quot;Don&#39;t have an account? Sign Up here!&quot;<br>                styleClass=&quot;p-button-link&quot;<br>                routerLink=&quot;/sign-up&quot;<br>              &gt;&lt;/p-button&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;mt-2 flex justify-content-center align-items-center&quot;&gt;<br>              &lt;p-button<br>                label=&quot;Already have an account? Login Here&quot;<br>                styleClass=&quot;p-button-link&quot;<br>                routerLink=&quot;/login&quot;<br>              &gt;&lt;/p-button&gt;<br>            &lt;/div&gt;<br>          &lt;/ng-template&gt;<br>        &lt;/p-card&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/form&gt;</pre><h3><strong>Using Route Guards</strong></h3><p>In Angular, route guards protect the routes.</p><p>Now I’ll explain how to use the canActivate() route guard mechanism to quickly secure routes from unwanted access.</p><p>Let us create our guard by using the command ng generate guard</p><p>ng generate guard shared/guard/auth</p><p>Select CanActivate()</p><p>Let us look at our isLoggedIn() method, which returns boolean if the users object is stored in localStorage</p><pre>// Returns true when user is looged in and email is verified<br>  get isLoggedIn(): boolean {<br>    const user = JSON.parse(localStorage.getItem(&#39;user&#39;)!);<br>    return user !== null &amp;&amp; user.emailVerified !== false ? true : false;<br>  }</pre><p>In our auth file in the canActivate() check if user is logged in and if no then return user to login-page as shown below</p><pre>constructor(private authService: AuthService, public router: Router) {}<br>  canActivate(<br>    route: ActivatedRouteSnapshot,<br>    state: RouterStateSnapshot<br>  ):<br>    | Observable&lt;boolean | UrlTree&gt;<br>    | Promise&lt;boolean | UrlTree&gt;<br>    | boolean<br>    | UrlTree {<br>    if (!this.authService.isLoggedIn) {<br>      this.router.navigate([&#39;&#39;]);<br>    }<br>    return true;<br>  }</pre><p>In our app-routing.module.ts file add canActivate to our route whose access we want to give to our authenticated users.</p><pre>{ path: &#39;&#39;, loadChildren: () =&gt; AuthenticateModule,  canActivate: [AuthGuard]  },</pre><p>I hope you liked the tutorial.</p><p>Follow for more. 🖥️❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2235783956f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>