I encounter an error message stating "The requested resource has been deleted" whenever another website links to my site

Having recently started working with Angular and Azure setups, I am facing an issue with a simple jade login form that posts to a URL (different origin than my website) upon submission. As a security measure, I have replaced the actual URL with a sample one.

form(name='loginForm' id="loginForm" method="post" action="https://www.test.userloginauth.com/test")
  .form-group
    input(type='text' name='user' class='form-control' required id='loginUser')
   .form-group
     input(type='password' name='pw' class='form-control' required id='loginPw')
    div.hidden
      input(type='hidden' name='site' value='gf')
    .login
      button(class='custom-button' name='Submit' type='submit' id='submit' value='Submit') Sign In

The validation of login credentials occurs at

https://www.test.userloginauth.com/test
, and upon successful verification, the user is redirected to my test page:
https://www.test.mysite.com/loggedin
. (Note: This page is located at /loggedin/index.jade - not sure if that affects anything. I have also tried /loggedin/test.jade.) Additionally,
https://www.test.userloginauth.com/test
sends a POST request back to this page containing the user's ID.

After entering valid login details, I was successfully redirected to

https://www.test.mysite.com/loggedin
as expected. However, the problem arises when I receive a 404 error message stating,
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
I am unsure why this error occurs only when
https://www.test.userloginauth.com/test
posts to my site, as navigating directly to
https://www.test.mysite.com/loggedin
loads the page perfectly.

I suspect there might be something missing in my web.config file. Here are the configurations I have attempted:

<httpProtocol>
  <customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Methods" value="GET,POST,DELETE,HEAD,PUT,OPTIONS" />
    <add name="Access-Control-Allow-Headers" value="Origin, X-Olaround-Debug-Mode, Authorization, Accept, Content-Type" />
    <add name="Access-Control-Expose-Headers" value="X-Olaround-Debug-Mode, X-Olaround-Request-Start-Timestamp, X-Olaround-Request-End-Timestamp, X-Olaround-Request-Time, X-Olaround-Request-Method, X-Olaround-Request-Result, X-Olaround-Request-Endpoint" />
  </customHeaders>
</httpProtocol> 

If anyone could provide assistance, it would be greatly appreciated!

Answer №1

Based on the error messages you're receiving, it's recommended to focus on these two key points:

  • Check if you've implemented the functionality for loggedin and made it accessible as a post route rule.
  • Verify if you have properly configured your web.config, such as having a server.js file in your root directory serving as the entry point for your application. In your web.config, ensure the following content is included:

    <handlers>
      <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
    </handlers>
    <rules>
        <clear />
        <rule name="DynamicContent">
              <conditions>
                 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
              </conditions>
              <action type="Rewrite" url="server.js"/>
        </rule>
    </rules>
    

    If you have any more concerns or questions, please don't hesitate to reach out.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can we pause and resume the progress bar using Javascript in conjunction with animationPlayState?

Looking for a way to control a progress bar script that runs for 180 seconds and then redirects the browser? Check out the code snippet below. I've added an onclick event to test pausing the progress bar. My goal is to pause, reset, and adjust the dur ...

Omitted Script within a Node.js JavaScript Code Segment

My code snippet is: function write_to_orchestrate(data_to_write) { console.log('more testing'); db.put('musician', '1', '{"test":"test1"}') .then(function (result) { res.send(result); ...

Tips on setting dynamic headers in tabulator

Is there a way to dynamically set the header name passed from JSON? Additionally, how can I hide multiple columns in Tabulator instead of just one? I would also like to be able to show/hide multiple columns on button click. These questions pertain to a co ...

What is the best way to add an insert button to every row?

Take a look at the image provided. When I click on any register button, the last row is being inserted instead of the desired row. What I'm aiming for is this: when I click register, the entire selected row should be stored in a separate table. Whe ...

Exploring the JSON object tree through recursion using underscore and backbone

If I have a JSON object with nested arrays of unknown depths and I want to pass each array into a _.template function, how can I make that happen? Here's an example of what my JSON object might look like: $start_elements = array ( array( ...

Is there a way to bypass the serialization and deserialization process for users in Passport.js?

Utilizing Passport.js and Angular for a web application, I aim to leverage Passport.js for authentication without the use of sessions. However, I consistently encounter an [Error: Failed to serialize user into session] each time I attempt to authorize a us ...

Is there a more efficient method for handling this JSON dataset?

After delving into Sitepoint's "Novice to Ninja" and starting to explore jQuery, I can't help but question if there is a more efficient way to write the code I've put together. The resounding answer appears to be "yes." All these cumbersome ...

How to arrange an array of objects by a property within a nested object using JavaScript?

var originalArray = [ { name: 'Shop1', stock: [ { name: 'Apples', quantity: [{ id: "something", time: 11 }, { id: "something", time: 44 }, { id: "something", time: 53 }] }, ...

Resetting the character count binding in an AngularJS form: The ultimate guide

Within my angular view, I have implemented multiple form fields that display character counts as the user types. I have a button or link that is meant to reset all of the form fields and character counts. However, after clicking the reset button, the form ...

Can you share a method for posting a dynamically assigned value in PHP?

After setting up a table in mySQL with fields like "name," I took it a step further by dynamically generating divs (each containing a form and a button) based on the number of rows in that table. Here's how it appears: <?php if ($tabLength > 0) ...

Updating a List Conditionally in React

Hello there! I am relatively new to the world of React and currently trying to grasp the concept of modifying elements within a list. Below, you'll find a straightforward example that illustrates my current dilemma. const numbers = [1, 2, 3, 4, 5]; / ...

What steps should I take to resolve the issue of "Uncaught Error: [News] is not a <Route> component. All components within <Routes> should be either a <Route> or <React.Fragment>"?

I'm having trouble with version 6 of react-router-dom while trying to create a news app. Can anyone help me with fixing it? When I use the following code, I encounter this error: Uncaught Error: [News] is not a component. All component children of ...

Leveraging CasperJS in a typical JavaScript script

I am currently working on a NodeJS project that involves integrating CasperJS. However, I have encountered an issue where the 'casper' module cannot be located. In an attempt to resolve this, I decided to npm install spooky --save based on some s ...

I'm new to learning JavaScript and I'm wondering how I can receive a single alert using only the if operator

Extracted from the book "Beginning JS 4th edition", this code snippet displays two alert messages when loaded in a browser due to two NaN entries in an array. To ensure that only one alert is shown every time, how can I achieve this using the if operator? ...

Experiencing difficulty fetching JSON data from a remote URL due to an error

I'm attempting to load a remote JSON file from this link. Initially, I used the $http.get function, but encountered the following error message: CORS 'Access-Control-Allow-Origin' Switching to JSONP didn't solve the issue either. ...

Tips on how to dynamically load the content of a URL into a modal and update the browser address simultaneously

I am attempting to achieve a specific effect using JavaScript and jQuery Link to the content I want to load in a modal The goal is to load the content in a modal while keeping the main page in the background. Additionally, when a URL is followed, I want ...

What is the process behind executing the scripts in the jQuery GitHub repository when running "npm run build"?

Check out the jQuery repository on GitHub. Within the jQuery repo, there is a "build" folder. The readme.md mentions the npm command: npm run build This command triggers the execution of scripts in the build folder to complete the building process from ...

Integrate a PHP variable into an HTML/JavaScript statement that was previously transformed from PHP

Incorporated within this PHP variable is a mix of HTML and JavaScript code. My task is to enhance it by adding another PHP variable. Specifically, I have a PHP variable denoted as $user->user_email. How can I seamlessly integrate this variable into th ...

What could be causing a parse error and missing authorization token in an AJAX request?

I recently wrote some code to connect a chat bot to Viber using the REST API. The main part of the code looks like this -: $.ajax({ url : url , dataType : "jsonp", type : 'POST', jsonpCallback: 'fn', headers: { 'X-Viber-Auth- ...

Having trouble with ng-click function, unable to figure out the issue

Hello, I've hit a roadblock while trying to troubleshoot an issue with my project. Oddly enough, ng-click has suddenly stopped functioning. Here are my routes $stateProvider .state('index', { url: '/', ...