Why isn’t my iframe showing in my HTML code?

I’m working on a web project where I have an iframe that should display a specific webpage, but for some reason, it’s not showing up. Here’s a simplified version of my HTML code:

<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Meta tags and CSS links -->
</head>
<body>
    <!-- Navbar and other content -->

    <!-- Code for iframe -->
    <div class="relative mx-auto container px-6">
        <div class="relative">
            <!-- Background elements -->
            <div class="absolute inset-0 -top-3 bg-gradient-to-r from-violet-600 to-indigo-600 rounded-xl transform -rotate-1 origin-bottom-left"></div>
            <div class="relative rounded-xl shadow-md h-full bg-white">
                <div id="demo-container" class="flex flex-col rounded-lg shadow-xl overflow-hidden h-full bg-gray-900">
                    <div class="shrink-0 flex items-center bg-gray-950 py-2 px-4 z-10">
                        <!-- Navbar indicators -->
                    </div>
                    <div class="flex-grow overflow-y-auto relative z-10">
                        <iframe class="absolute inset-0 w-full h-full" src="/schedule"></iframe>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

However, despite setting the src attribute of the iframe to “/schedule”, the iframe is not displaying the content it should. I’ve checked the source URL (“/schedule”) separately, and it loads fine, so I’m unsure why it’s not working within the iframe. Any insights into what might be causing this issue would be greatly appreciated.

im also using tailwind css

Full Code if Necessary:
https://codepen.io/Avisator4/pen/XWQyNQE

Dynamic horizontal nav bar where nav items “overflow” into a “more” dropdown when those nav items would normally wrap

I’m trying to modify this fiddle https://jsfiddle.net/xobea9cm/ as it pretty much has the exact function that I’m after, except the semantics of the html are not great.

In a nutshell, I’m after a horizontal navigation like so

|header and hero                                 |
|nav item 1   nav item 2    nav item 3   MORE v  |
|body copy                                       |

Within “more” there would be “nav item 4” and “nav item 5”. It would change with screen size. As you reduce the browser width, “nav item 3” would be moved into “more”, as you increase the browser width, the nav items within “more” would flow back out when horizontal space permits.

The original version html is “divitus” and looks like:

<nav class="nav">
    <div id="menu" class="menu">
        <div class="menuitem">One</div>
        <div class="menuitem">Two</div>
        <div class="menuitem">Three</div>
        <div class="menuitem">Four</div>
        <div class="menuitem">Five</div>
        <div class="menuitem">Six</div>
        
        <div class="more-items">
            <div id="more" class="more-item menuitem">More</div>
            <div class="menuitem">Seven</div>
            <div class="menuitem">Eight</div>
            <div class="menuitem">Nine</div>
        </div>
    </div>
</nav>

My version is here: https://jsfiddle.net/oywkdr6e/ where my html currently looks like:

<nav class="nav-more">
    <ul class="nav-more-menu">
        <li class="nav-more-menu-item">nav item one</li>
        <li class="nav-more-menu-item"><a href="#two">nav item two</a></li>
        <li class="nav-more-menu-item"><a href="#three">nav item three</a></li>
        <li class="nav-more-menu-item"><a href="#four">nav item four</a></li>
        <li class="nav-more-menu-item"><a href="#five">nav item five</a></li>
        <li class="nav-more-menu-item"><a href="#six">nav item six</a></li>
        
        <li class="more">
            <!--THIS IS WHAT I'M TRYING TO CHANGE-->
            <li class="more-trigger nav-more-menu-item">More</li>
            <li class="nav-more-menu-item"><a href="#seven">nav item seven</a></li>
            <li class="nav-more-menu-item"><a href="#eight">nav item eight</a></li>
        </li>
    </ul>
</nav>

What I want is this:

<nav class="nav-more">
    <ul class="nav-more-menu">
        <li class="nav-more-menu-item">nav item one</li>
        <li class="nav-more-menu-item"><a href="#two">nav item two</a></li>
        <li class="nav-more-menu-item"><a href="#three">nav item three</a></li>
        <li class="nav-more-menu-item"><a href="#four">nav item four</a></li>
        <li class="nav-more-menu-item"><a href="#five">nav item five</a></li>
        <li class="nav-more-menu-item"><a href="#six">nav item six</a></li>
        
        <li class="more">
            <!--THIS IS WHAT I WANT-->
            <button class="more-trigger">More</button>
            <ul class="more-items">
                <li class="nav-more-menu-item"><a href="#seven">nav item seven</a></li>
                <li class="nav-more-menu-item"><a href="#eight">nav item eight</a></li>
            </ul>
        </li>
    </ul>
</nav>

The current functionality has the “more” menu displaying on a hover of <li class="more">, but I eventually want that available on a button trigger for accessibility, so I’ll just show/hide that button’s sibling <ul class="more-items"> and position it like a dropdown menu.

I’ve tried several times to update the JS for the new markup but I seem to always end up at the same place. On page load, it looks good, but when I resize the browser width, my DOM gets appended with <ul class="more-items"> on every resize event.

How would you fix this to output the desired markup? There’s something I’m just not getting with updating the DOM. Here is the JS:

const parser = new DOMParser();

function dealWithMenu(navMoreMenu) {
  //console.log('dealWithMenu()');
  let navLIs = navMoreMenu.querySelectorAll('li');
  let moreLI = parser.parseFromString('<li class="more"></li>', 'text/html').body.firstChild;
  //console.log('navLIs:', navLIs);
  //console.log('moreLI:', moreLI);
  //console.log('navMoreMenu:', navMoreMenu);

  let count = 0;

  for (var i = navLIs.length; i--;) {
    let $this = navLIs[i];

    //show at least two nav items
    if (count >= navLIs.length - 2) {
      continue;
    }

    //if trailing nav item offsetTop value is different than first nav item, trailing nav item has wrapped to a new line, so move into "more" dropdown
    if ($this.offsetTop > navLIs[0].offsetTop || moreLI.offsetTop > navLIs[0].offsetTop) {
      navMoreMenu.appendChild(moreLI);
      moreLI.insertBefore($this, moreLI.firstChild);
      count++;
    } else {
      i = 0;
    }
  }

  //we have overflow nav items in "more" dropdown
  if (moreLI.children.length) {
    console.log('moreLI.children.length', moreLI.children.length);
    moreLI.insertBefore(
      parser.parseFromString('<li class="more-trigger nav-more-menu-item">More</li>', 'text/html').body.firstChild,
      moreLI.firstChild
    );
  }

  moreLI.addEventListener('click', (e) => {
    console.log('more click:', e.target);
  });
}

function shorterMenu() {
  //console.log('shorterMenu()');
  const navMoreMenu = document.querySelector('.nav-more-menu');
  const moreLI = navMoreMenu.querySelector('.more');
  const moreTrigger = navMoreMenu.querySelector('.more-trigger');
  //console.log('moreLI:', moreLI);
  //console.log('moreTrigger:', moreTrigger);

  moreTrigger?.remove();    

  if (moreLI != undefined && moreLI.children?.length > 0) {
    Array.from(moreLI.children).forEach(child => moreLI.parentElement.appendChild(child));
    moreLI.remove();
  }

  dealWithMenu(navMoreMenu);
}

shorterMenu();
window.addEventListener('resize', () => shorterMenu());

How to add subtasks to an existing issue through Jira REST API?

I’m trying to add a subtask to an existing issue on my development environment. But I’m not succeeding on it.

Here is my function:

const getID = async (projectId) => {
    const res = await requestJira(
      `/rest/api/3/issuetype/project?projectId=${projectId}`
    );
    const data = await res.json();
    const taskId = foundIdTask(data);
    return taskId;
  };

  const createSubtasks = async () => {
    const parentIssueKey = context.extension.issue.key;
    const parentIssueId = context.extension.issue.id;
    const projectId = context.extension.project.id;
    const issueType = await getID(projectId); 
  
    if (!issueType) {
      console.error("No valid subtask issue type found.");
      return;
    }
  
    const requestBody = {
      "fields": {
        "project": {
          "id": projectId
        },
        "parent": {
          "id": parentIssueId 
        },
        "summary": "Subtask Example",
        "description": {
          "type": "doc",
          "version": 1,
          "content": [{
            "type": "paragraph",
            "content": [{
              "text": "This is a detailed description of the subtask.",
              "type": "text"
            }]
          }]
        },
        "issuetype": {
          "id": issueType
        }
      }
    };
  
    const response = await requestJira(`/rest/api/3/issue/`, {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(requestBody)
    });
  
    if (response.status === 201) {
      console.log("Subtask created successfully!");
    } else {
      console.error("Failed to create subtask:", await response.text());
    }
  };

And I’m getting this error message: Failed to create subtask: {“errorMessages”:[],”errors”:{“parentId”:”Given parent issue does not belong to appropriate hierarchy.”}}

And I don’t know what else to do because I’m getting the actual key and id of the issue that I want to work on. And I can add subtasks to this issue with no problem by using the Jira software.

Can someone help me?

Thanks

I’ve also tried the route “bulk” but I think my request body is not correct, but I can’t get it correctly.

Download failed using browser.downloads.download() API in popup.js firefox addon

I have this function in popup.js in a firefox extension that should download a file generated in the code.
The download is initialized but then fail without any apparent error other than the file saying “download failed” in the download section of the browser.
I’ve tried it with an url from the internet and it works fine.

function download() {
  const blob = new Blob(["smssjsjssjsj"], { type: "text/plain" });

  // Create a URL for the Blob
  const url = URL.createObjectURL(blob);
  // Initiate the file download using the downloads API

  browser.downloads.download(
    {
      url: "url",
      filename: `xxxa.txt`,
      saveAs: false,
    },
    (downloadId) => {
      if (chrome.runtime.lastError) {
        errmessage.innerText =
          "Download failed:" + chrome.runtime.lastError.message;
      }
    }
  );
  URL.revokeObjectURL(url);
}

Transform PPTX file to HTML using Tailwind CSS for design

I have a powerpoint file and i need to convert each slide into HTML and need to use tailwind CSS for the design part.

I tried converting using npm module pptx but did not work. I tried following code –

const pptx = require('pptx');
const fs = require('fs');

// Path to your PPT file
const pptPath = 'path/to/your/file.pptx';

// Create a new presentation object
const pres = new pptx.Presentation(fs.readFileSync(pptPath));

// Output directory for HTML files
const outputDir = 'path/to/output/directory';

// Convert each slide to HTML
pres.slides.forEach((slide, index) => {
    const slideHtml = slide.getContent();
    
    // Add Tailwind CSS to the HTML
    const htmlContent = `
        <!DOCTYPE html>
        <html lang="en">
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>Slide ${index + 1}</title>
            <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
        </head>
        <body>
            ${slideHtml}
        </body>
        </html>
    `;

// Write the HTML content to a file
    fs.writeFileSync(`${outputDir}/slide${index + 1}.html`, htmlContent);
});

I got the following error –



Error: Cannot find module 'C:Usersrjuna.vscodepptx to htmlnode_modulespptxindex.js'. Please verify that the package.json has 


a valid "main" entry...................................


code: 'MODULE_NOT_FOUND',


  path: 'C:\Users\rjuna\.vscode\pptx to html\node_modules\pptx\package.json',


  requestPath: 'pptx'```

element-plus components does not work as expect (el-row does not strech full width)

Start a Vue project as Vue3 Quick Start.

npm create vue@latest

Install element-plus as Element plus Installation.

npm i element-plus

Use it by full import.

Then try Element Layout, copy the code to App.vue, run npm run dev, but the page is totally blank.

Then test for this:

<template>
  <el-row>
    <el-col :span="24">
      <el-button>button</el-button>
    </el-col>
  </el-row>
</template>

<style lang="scss">
.el-row {
  background-color: black;
}
</style>

Get:

enter image description here

Try:

<template>
  <el-row>
    <el-button>button</el-button>
  </el-row>
  <el-row>
    <el-col :span="24">
      <el-button>button</el-button>
    </el-col>
  </el-row>
</template>

<style lang="scss">
.el-row {
  background-color: black;
}
</style>

Get:

enter image description here

The el-row does not strech full width and two el-row is in the same line. How to make Element Plus work as expect?

Although I’m not proficient in using Vue and Element Plus, but I wrote a small project using them before (about Oct 2023). I remembered that they can work well by following the docs.

Element Plus – [Bug Report] el-row type #1912

Accessing parent div from child element

I have 2 radio buttons. Each of these radio buttons are connected to an image.
At the start these images are in black and white (filter:grayscale(1)).
When one of these buttons are selected, I want the image the button relates to turn (filter:grayscale(0)).
The grayscale filter attribute is specified in the <img> element. Each of these radio buttons are wrapped into a seperate div, with their respective <img>.

The first step (I think) is to collect the input name that relates to the radio button that is selected. And this works.
I believe from this input name, I need to search for the parent div, and then look for the <img> element it relates to.

I will admit it, writing this feels a bit complicated. But I cannot think of a better way.

my problem

Where I am struggling now is to fetch the parent div based on the checked input name.
I found a bit of document using either .parentElement(), .parent() and parent.Node() but none of these work. Or probably I am not using them properly.
Then once the parent div is identified, I can probably look for the child <img> element.

My question(s)

  1. How do I access the parent div from the child element id?
  2. Is there a better way/ simpler way to achieve this?
$(document).ready(function() {
  /*Manages Radio buttons & images rendering when clicked*/
  $('input[name="hero-avatar"]').change(function() {
    // Check if the radio button is checked
    if ($(this).is(':checked')) {
      // captures id of button that is checked
      let checkButton = $(this).attr('id');
      // Log checked radio button id
      console.log(checkButton);

      //test to find parent div class
      console.log($(`#${checkButton}`).parent().attr('class'));

      //this works but doesnt reach the parent div class which contains grayscale property
      $(`#${checkButton}`.parentNode).css('filter', 'grayscale(0)')

    }
  });

  //if radio button is checked
  //change colour of image attached to it
});
.avatar-img-select {
  height: 52px;
  filter: grayscale(1);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<div class="row first-screen-row-avatar">
  <div class="col select-avatar-col">
    <label for="avatar1">
        <img src="assets/images/avatars/hero-avatar-1.jpg" class="avatar-img-select" alt="Avatar 1">
        <input type="radio" id="avatar1" name="hero-avatar" value="assets/images/avatars/hero-avatar-1.jpg" required>
    </label>
  </div>
  <div class="col select-avatar-col">
    <label for="avatar2">
        <img src="assets/images/avatars/hero-avatar-2.webp" class="avatar-img-select" alt="Avatar 2">
        <input type="radio" id="avatar2" name="hero-avatar" value="assets/images/avatars/hero-avatar-2.webp" required>
    </label>
  </div>
</div>

How Do I Use AWS Amplify GraphQL Mutations on Nextjs Pages/API Routes?

I’ve taken the code examples from the AWS Amplify V6 docs.

My goal is to be able to update anyone’s Dynamodb record via this backend function.

amplifyServerUtils.ts:

import { createServerRunner } from "@aws-amplify/adapter-nextjs";
import config from "@/src/aws-exports";

export const { runWithAmplifyServerContext } = createServerRunner({
  config
});

pages/api/test.js:

import { fetchAuthSession } from "aws-amplify/auth/server";
import { NextResponse } from "next/server";
import { runWithAmplifyServerContext } from "@/src/utils/amplifyServerUtils";

const handler = async (request) => {
  const response = NextResponse.next();

  const authenticated = await runWithAmplifyServerContext({
    nextServerContext: { request, response },
    operation: async (contextSpec) => {
      try {
        const session = await fetchAuthSession(contextSpec);
        return session.tokens !== undefined;
      } catch (error) {
        console.log(error);
        return false;
      }
    },
  });

  if (authenticated) {
    return response;
  }

  return NextResponse.redirect(new URL("/sign-in", request.url));
};

export const config = {
  matcher: [
    "/((?!api|_next/static|_next/image|favicon.ico|sign-in).*)",
  ],
};

export default handler;

AWS Amplify Issue

Issues with JavaScript Alert in WordPress Theme (Blocksy) Development

I want to develop something on WordPress, using the Blocksy theme.

Firstly, I want to test if my HTML and JavaScript work properly by creating a simple input button.

I tested it in VScode first. When the user enters an email and clicks submit, the webpage should show an alert saying “Hello from JavaScript!”

Here’s my code:

HTML (body part only):

<form>
    <label for="email">Enter Email Address</label>
    <input type="email" id="emailInput" name="email" multiple="">
    <input type="submit" id="useremail" name="submit">
    <script src="index.js"></script>     
</form>

index.js:

document.addEventListener('DOMContentLoaded', function () {
    document.getElementById("useremail").onclick = function() {
        alert("Hello from JavaScript!");
    };
});

After testing in VScode and confirming it works, I tried the same code on WordPress. However, no matter what I try, the alert message doesn’t show up after clicking submit.

I’ve read through many articles but still haven’t found a solution. Here are the steps I followed:

  1. open edit post page.
  2. Upload “email-script.js” to “/wp-content/themes/blocksy/static/js/”, so the path is “/wp-content/themes/blocksy/static/js/email-script.js”.
document.addEventListener('DOMContentLoaded', function () {
    var form = document.querySelector('form');
    form.onsubmit = function(event) {
        event.preventDefault();  // Prevents the form's default submission behavior
        alert("Hello from JavaScript!");
    };
});
  1. Add a custom HTML block and paste the code (changed src to my custom JavaScript path according to my blocksy path):
<form>
    <label for="email">Enter Email Address</label>
    <input type="email" id="emailInput" name="email" multiple="">
    <input type="submit" id="useremail" name="submit">
    <script src="/wp-content/themes/blocksy/static/js/email-script.js"></script>
</form>
  1. Added the following code to “/wp-content/themes/blocksy/functions.php”:
function load_custom_scripts() {
    wp_enqueue_script('custom-email-script', get_template_directory_uri() . '/static/js/email-script.js', array(), false, true);
}

add_action('wp_enqueue_scripts', 'load_custom_scripts');

I’ve checked the console, there is no error. Is there anything I’m missing?

What’s the purpose of nuxt-auth secret for jwt tokens?

I understand why a backend generates a jwt token and why it uses a secret to validate the authenticity of the token. But I don’t understand why sidebase/nuxt-auth configuration requires a secret in the following call:

// file: ~/server/api/token.get.ts
import { getToken } from '#auth'

const secret = process.env.NEXTAUTH_SECRET

export default eventHandler(async (event) => {
  const token = getToken({ event, secret })
  return token || 'no token present'
})

From what I understood from the internet, this secret purpose seems to decode and encode the jwt token. But why? I am trying to understand why nuxt-auth uses this secret for the tokens and if it is something that I need to worry.

As for now the backend that I have generates a jwt token when a user logs in and this token is used attached to the headers of a request from the frontend to the backend in order to authenticate the user. So why does the frontend need a secret for jwt tokens? I apologize if I said something wrong, I am still learning about authentication with jwt tokens.

How to include attribute value while building XML using fast-xml-parser?

fast-xml-parser version 4.3.6

Description

I need to include xml attribute (tokenized=”true”), like this : <custom-tag tokenized="true">test test &gt; 14</custom-tag>

Input

Code

var defaultXmlOptions = {
      ignoreAttributes: false,
      attributeNamePrefix: "@_",
      indentBy: "  ",
      textNodeName: "#text",
      format: true,
  },
var testJson = { component: {
      "custom-tag": {
          "#text": "test test > 14",
          "@_tokenized": true
      }
  }}

Here is the code that converts:

var parser = new XMLBuilder(defaultXmlOptions);
var xml = parser.build(testJson);

Output

<component>
  <custom-tag tokenized>test test &gt; 14</custom-tag>
</component>

That attribute should have =”true”

Expected Output

<component>
  <custom-tag tokenized="true">test test &gt; 14</custom-tag>
</component>

Old Code that used to work

var Parser = require("fast-xml-parser").j2xParser;
var parser = new Parser(defaultXmlOptions);
var xml = parser.parse(testJson);

Now converting my Project from CRA to Vite can’t use require.

Using position: sticky to fix an element to the top of its parent container

I am developing an reusable component that has a banner which should be fixed to the top of its parent component.

I am struggling to get the banner to stay fixed reletive to its parent rather than fixing itself to the top of the entire app.

My basic app structure is as follows:

    <div className="App">
      <div className="header"></div>
      <div className="content">
        <div className="banner">HEllo</div>
        <div className="form"></div>
      </div>
    </div>
.header {
  display: flex;
  -webkit-box-flex: 1;
  flex-grow: 1;
  margin: 0px 25px;
  height: 64px;
  background-color: blue;
  position: fixed;
  top: 0px;
  z-index: 999;
  width: 100%;
}

.content {
  width: inherit;
  box-sizing: border-box;
}

.banner {
  position: sticky;
  top: 0px;
  width: inherit;
  z-index: 100;
  box-sizing: border-box;
  background-color: red;
  width: 100%;
}

.form {
  padding-top: 15px;
  padding-left: 24px;
  padding-right: 24px;
  display: flex;
  flex-flow: wrap;
  width: 100%;
  height: 1000px;
  background-color: green;
  z-index: -9;
}

The content section of this is being abstracted into its own component so I can’t change top:0

Sandbox

CryptKeyword and decryptKeyword using php and Javascript

I have two function encryptKeyword and decryptKeyword

function encryptKeyword($keyword, $token)
{
    $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));

    $encrypted = openssl_encrypt($keyword, 'aes-256-cbc', $token, 0, $iv);

    $encryptedWithIV = base64_encode($iv . $encrypted);

    return $encryptedWithIV;
}

function decryptKeyword($encryptedKeyword, $token)
{
    $data = base64_decode($encryptedKeyword);

    $iv = substr($data, 0, openssl_cipher_iv_length('aes-256-cbc'));
    $encrypted = substr($data, openssl_cipher_iv_length('aes-256-cbc'));

    $decrypted = openssl_decrypt($encrypted, 'aes-256-cbc', $token, 0, $iv);

    return $decrypted;
}

But When I want to decrypt keyword using Javascript not working

I want to encryptKeyword and decryptKeyword using javascript code

How to Verify User Email and Retrieve Full Name Using MSAL Authentication and Azure Functions

I’m working on an application where users log in using MSAL authentication, and during registration, I’ve granted the scope of user.ReadBasic.All permission for the Microsoft Graph API. Now, I need to verify if the provided user email (login user and email provided by login user to verfiy are different) belongs to the same tenant and, if verified, retrieve their full name.

Here’s my current approach:

  • Frontend: Users log in using MSAL authentication.
  • Backend (Azure Function Endpoint API): I receive the email to verify and the access token in the request. I then decode the token to extract the user’s email.
  • Next, I compare the domain of the provided email with the domain extracted from the decoded token. If they match, I consider the email verified.

However, this approach only verifies if the email domain matches the tenant, which doesn’t guarantee that the email belongs to an actual user. Instead, I need to ensure the email belongs to a valid user within the tenant and retrieve their full name.

Can anyone guide me on how to achieve this? Specifically, how can I validate the user’s email and retrieve their full name using MSAL authentication and Azure Functions?

following is my code where I have removed comparison and jwt decode logic.

module.exports = async function (context, req) {
    const tenantId = "YOUR_TENANT_ID"; 

    if (req.method === 'POST') {
        try {
            const { email } = req.body;
            const token = req.headers.authorization;

            if (!token || !email) {
                context.res = {
                    status: 400,
                    body: "Token in the 'Authorization' header and email in the request body are required."
                };
                return;
            }
            const bearerToken = token.split(' ')[1];

            // we decode jwt token to get tenantid and email

            if (!decoded || decoded.tid !== tenantId) {
                context.res = {
                    status: 403,
                    body: JSON.stringify({ error: 'Unauthorized: Invalid token or tenant' })
                };
                return;
            }

            const userEmail = decoded.preferred_username;
            if (typeof userEmail !== 'string' || typeof email !== 'string') {
                context.res = {
                    status: 400,
                    body: JSON.stringify({ error: 'Invalid email format' })
                };
                return;
            }

            // we check email domain comparison here 

            if (providedDomain !== tokenDomain) {
                context.res = {
                    status: 400,
                    body: JSON.stringify({ error: 'Email does not match the tenant. Verification failed.' })
                };
                return;
            }
            context.res = {
                status: 200,
                body: JSON.stringify({ message: 'Email matches the tenant. Verification successful.' })
            };

        } catch (error) {
            context.log.error('Token verification error:', error.message);
            context.res = {
                status: 401,
                body: JSON.stringify({ error: 'Invalid token' })
            };
        }
    } else {
        context.res = {
            status: 405,
            body: "Method Not Allowed"
        };
    }
};

Any help or suggestions would be greatly appreciated. Thank you!

All I am trying to do is create an Azure Function API that checks whether an email is valid or not when a login user from the same tenant sends a request to verify other email (so that user can exclude non verified email for any kind of registration within company).