Working with DOT in URLs using AngularJS UI-Router

I am currently facing an issue while trying to authenticate users using the Google API. The problem arises when the return data in the parameters contain a DOT within the token, causing the server to break as it requests a page that does not exist. However, when I remove the DOT, everything works perfectly fine.

Below is an example of the URL:

http://localhost:9000/developer/auth/google?code=4/ubXcE1qq84XFtsAwT00_BWkLKR9RldGk6zhBS8ZSiTw.El_qMeir0J0coiIBeO6P2m_ee_B7kwI

Here is the state handler:

  .state('/developer/auth/google', {
    url: '/developer/auth/google?code',
    templateUrl: 'views/developer/auth/google.html',
    controller: 'DeveloperAuthGoogleCtrl',
    resolve: {
    code: function($stateParams) {
        return $stateParams.code;
      }
    }
  })

Thank you

Answer №1

Encountered a similar problem like yours.

The issue was resolved by modifying the rewrite rule on the node server. I am now able to utilize DOT with any parameter.

Take a look at this revised rewrite rule:

modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png$ /index.html [L]'])

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

Is there a way to flip a figure that is flipped upside down?

I'm currently working on creating a map using a json file to go from d3.js to Three.js. However, when the map is displayed, it appears upside down. I'm wondering if there is a way to flip it so that it displays correctly. As a newcomer to d3 and ...

Guide to authenticating Cashfree gateway's webhook signature using JavaScript

I have integrated the Cashfree payments gateway successfully. However, I am unsure how to verify the signature of webhooks. https://i.stack.imgur.com/TxdTx.png This is their recommended approach. Could someone guide me on writing JavaScript code for this ...

Ways to access configuration settings from a config.ts file during program execution

The contents of my config.ts file are shown below: import someConfig from './someConfigModel'; const config = { token: process.env.API_TOKEN, projectId: 'sample', buildId: process.env.BUILD_ID, }; export default config as someCo ...

Interacting between Angular.js controllers and Polymer custom elements

Incorporating Angular.js and Polymer in my project has been a challenge, particularly when it comes to the communication between Angular.js controllers and Polymer custom elements. One specific issue I've encountered involves implementing an AuthServ ...

Dealing with multiple POST requests at once in Node Express JS - Best Practices

I've been working on a Node project with Express to handle incoming GET/POST requests. I have set up routes to manage various types of requests. One specific route, /api/twitter/search, calls a function that uses promises to retrieve Twitter feeds and ...

How can I create a clickable <div> element containing multiple links and trigger only one action?

Within my code, there is a <div> element that has been made clickable. Upon clicking this <div>, the height and text expand using the jQuery function $(div).animate();. While this functionality works as intended, I am encountering a slight issu ...

My Ajax script is not recognizing the select tag value?

I am struggling with an ajax script that is supposed to send data from a contact form to a PHP script. The main issue I'm facing is that I can't seem to retrieve the value from the "select" tag. My knowledge of JavaScript/ajax is limited, so plea ...

Center both vertically and horizontally in Bootstrap UI Modal

I'm attempting to create a Bootstrap UI Modal that is centered both vertically and horizontally. While I found this solution that successfully centers the modal vertically, it loses its horizontal centering when applied to my own template with 800px ...

What is the best way to dynamically update form fields in a database after making a selection in a <select> component?

Currently, I have a form that displays a list of stars (stellar objects) with a <select> control and two <inputs>. I am seeking guidance on how to populate the two inputs from the database when the user changes the selection in the <select&g ...

When async/await is employed, the execution does not follow a specific order

I'm curious about the execution of async/await in JavaScript. Here are some example codes: async function firstMethod(){ new Promise((resolve, reject)) => { setTimeout(() => { resolve("test1"); }, 3000); }); } async ...

Assess the HTML containing v-html injection

Is there a way to inject raw HTML using Vue, especially when the HTML contains Vue markup that needs to be evaluated? Consider the following example where HTML is rendered from a variable: <p v-html="markup"></p> { computed: { m ...

Activate Button upon Textbox/Combobox/RadDatePicker Modification through JavaScript

On my ASP.NET form, I have various input elements including textboxes, dropdowns, date pickers, and update buttons. My goal is to enable the update button whenever a user makes a change in any of these fields. To achieve this, I applied a specific CSS cla ...

Is there a way to retrieve the file path of the file that is imported using an alias in Vite (Vue3)?

Hello! I have a few inquiries. Is it feasible to obtain the file path of the file utilizing an alias for import in Vite (Vue3)? Setup Here's the directory structure I'm using, purely for illustrative purposes: src/ module_a/ some_ ...

The position of the jQuery VirtualKeyboard is not displaying correctly

I'm currently experiencing an issue with the placement of the keyboard while using the Mottie/Keyboard plugin. The images provided below illustrate my desired outcome and the current behavior: https://i.sstatic.net/GULve.png Despite my attempts, the ...

AngularJS $q.all doesn't pause for guarantees

Currently, I'm in the process of building a basic app using Ionic/AngularJS that is designed to save contacts directly into the phone's address book. Within my code, there's a controller set up to receive contact information and then store i ...

Navigating the reactive array in Vue 3 with finesse

Currently, I'm facing some challenges with my Vue 3 app in terms of getting things to work as expected. The main issue lies in properly accessing a reactive array. Let me provide you with the code for better comprehension: Within my global store sto ...

The fade effect in React and material ui is consistent across both elements

I am facing an issue with a list where, for each list sibling onclick, a different element fades in with different text. The problem occurs when the fade effect starts once on siblings in the list and then disappears, not enabling again. This is the code: ...

Verify the form data before triggering the ajax call with just one click

Ensuring that all required areas are completed in a form is crucial. The form needs to be validated properly to either reject the request with a message showing what information is missing, or submit it successfully... The rejection process works well as ...

JavaScript: Transforming binary information from Uint8Array into a string causing file corruption

In my attempt to send a video file to a server in chunks using a basic jQuery $.ajax call, I followed these steps: Utilized the slice() method on the file object to extract a chunk Used FileReader.readAsArrayBuffer to read the generated blob Generated a ...

Angular: URL is lost upon second click during state change

There are 4 different states, each representing a unique visualization. The first state displays a map, while the remaining three states show pie charts. By default, the map visualization is loaded. However, there are icons available to switch to the othe ...