Is there a way to access the original query string without it being automatically altered by the browser?

I'm currently encountering an issue with query strings. When I send an activation link via email, the link contains a query string including a user activation token. Here's an example of the link:

http://localhost:3000/#/activation?activation_code=27kVNlC4ShWuL4pkH3/FhVA==
. However, when clicking on the link, the browser automatically modifies the query string to be
http://localhost:3000/#/activation?activation_code=27kVNlC4ShWuL4pkH3%2FhVA
, leading to an encryption error. Any suggestions on how I can retrieve the original query string? My front end is Angular and I'm using ASP.NET Web API.

Answer №1

It appears that the activation code included in your url contains some reserved characters. For more information on this topic, please refer to this question: Understanding Reserved Characters

To avoid any issues, I recommend encoding the activation token before adding it to the url.

Answer №2

Make sure to properly encode your token with URL encoding due to the presence of reserved characters.

Remember to utilize encodeURIComponent() in order to encode any special characters present in the token.

Answer №3

Here is a useful code snippet:

Use Server.UrlDecode(activation_code) for decoding

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

Tips for running an AngularJS1 application on an Nginx server alongside other applications

I have an AngularJS application located in a folder named dist. I want to host this app on my nginx server. Currently, my nginx server is hosting multiple applications using proxy_pass. Since I have never hosted a static HTML app on nginx before, I'm ...

Unable to send parameters via URL when making an Ajax request in Rails

Struggling to pass a parameter through a URL in an Ajax request that's triggered by a confirmation dialog. Need the value of that parameter in my Rails controller upon successful request but can't seem to make it work. Tried the following code s ...

Tips on how to showcase the data utilizing the $http.get method

Currently in my application, I am attempting to retrieve a JSON array from the database using the $http.get method. However, upon execution, I am facing an issue where the fetched data is not being displayed on the view page. Interestingly, when I check ...

Customize Your Lightbox Fields with DHXScheduler

In my JSP application for exam timetabling, I have integrated DHXScheduler and customized the lightbox to display additional information about exams using my own fields. The EventsManager class is responsible for managing events by saving, creating, and r ...

The express app is configured to send a 301 status code when Supertest is used, and it is

Hello, I am currently utilizing supertest to test the functionality of my Node.js express server application. My goal is to accomplish the following: let request = require('supertest'); let app = require('./server.js'); request(app). ...

Slider component designed for selecting ranges of letters in the alphabet using

Currently, I am working on creating a website using Angular for a school project. One feature I am experimenting with is a slider for selecting classes ranging from class 1 to class 5. The classes are stored in arrays, so when users slide to select a range ...

Issue with Bootstrap tab display of content

I'm having trouble with the tabs in my page. When I click on each tab, the content doesn't display correctly. Here is my code: <div class="w470px exam" style="border: 1px solid #ddd; margin-top: 30px;"> <ul id="myTab" class="nav nav ...

What steps should be taken to fix the error "Warning: Encountered multiple children with the same key" in React.js?

I'm having trouble fetching and displaying data from an API. Whenever I attempt to show the data, I encounter the following error message: Alert: Found two children using the same key, [object Object]. Keys must be unique so that components can pro ...

ReactJS is in need of extracting certain values from a promise

Within my Firebase database, I have organized data into two Documents: "users" and "posts". Each post in the "posts" collection is linked to a specific user using their unique id from the "users" collection. My goal is to retrieve user data associated wi ...

Tips for sending back a response after a request (post | get) is made:

In the service, there is a variable that verifies if the user is authorized: get IsAuthorized():any{ return this.apiService.SendComand("GetFirstKassir"); } The SendCommand method is used to send requests (either as a post or get request): ApiServi ...

Creating code in AngularJS

I have the following template structure: <h1 class="text-center" ng-bind-html="row.text"></h1> When the content of my row.text is a string like this: Hi your name is {{ name }} It will display as shown below: Hi your name is {{ name }} ...

Guide on displaying the AJAX response within an HTML or JSP element pulled from a database

description of image 1description of image 2How can I display an AJAX response from a database (map) on a JSP screen? I am able to retrieve the response in the browser console but unsure how to visually render it on the JSP page, like in a table or any ot ...

The value control input does not get properly updated by ngModelChange

Having difficulty updating an input as the user types. Trying to collect a code from the user that follows this format: 354e-fab4 (2 groups of 4 alphanumeric characters separated by '-'). The user should not need to type the '-', as it ...

What is the best way to adjust the width of these elements for a perfect fit?

I'm currently working on a website where I have arranged squares in a grid layout. My goal is to make these squares perfect, with equal width and height. The only issue I'm encountering is that they tend to change between fitting two and three sq ...

Learning to control the JavaScript countdown clock pause and play functionality

How can I control the countdown timer to play and pause, allowing me to resume at the exact time it was paused? At the start, the timer is set to play. Please keep in mind that the button appears empty because the font-awesome package was not imported, b ...

Make your CSS and JS files smaller by using a PHP compression script in your WordPress child theme

  I am looking to implement a PHP script that will serve combined, pre-gzipped, and minified JS and CSS files. You can find the source code for this script here: https://code.google.com/p/compress/ I have a WAMP localhost with WordPress install ...

Angular 2 - The creation of cyclic dependencies is not allowed

Utilizing a custom XHRBackend class to globally capture 401 errors, I have encountered a dependency chain issue in my code. The hierarchy is as follows: Http -> customXHRBackend -> AuthService -> Http. How can this problem be resolved? export cla ...

Is it possible for you to execute 2 procedures consecutively simply by clicking on a button?

My question is quite straightforward. I have two buttons: <button @click="getPartyLeader" class="btn btn-success">Get party leader</button> <button @click="saveParty" class="btn btn-success">Submi ...

Generate a dynamic animation by combining two images using jQuery

My attempt to animate two images is not working. I received some help on Stack Overflow but still facing issues with my CSS and HTML code. This is the code I am using: $(document).ready(function() { $(".animar").click(function() { $("#img4" ...

Remove properties that are not part of a specific Class

Is there a way to remove unnecessary properties from the Car class? class Car { wheels: number; model: string; } const obj = {wheels:4, model: 'foo', unwanted1: 'bar', unwantedn: 'kuk'}; const goodCar = filterUnwant ...