AWS hosted website with password credentials, opens up password credentials
Unanswered
Basset Fauve de Bretagne posted this in #help-forum
Basset Fauve de BretagneOP
I have a website hosted in amplify and it has password credentials setup on every visit to it. Now I have a button that will do router.push to an external site after it has been clicked. However, instead of redirecting to the external website, it opens up the password prompt instead
This is using pages directory btw, 13.2.3
This is using pages directory btw, 13.2.3
11 Replies
Basset Fauve de BretagneOP
sure @Ray
<button onClick=(()=>{
router.push(resolveUrl("/home"));
})export function resolveUrl(path: string) {
switch (environment) {
case "DEVELOP":
case "LOCAL":
return `https://develop-shop.com${path}`;
case "STAGING":
return `https://staging-shop.com${path}`;
default:
return `https://www.shop.com${path}`;
}
}This is the resolver function
@Basset Fauve de Bretagne sure <@743561772069421169>
jsx
<button onClick=(()=>{
router.push(resolveUrl("/home"));
})
how did you setup the password credentials? with base auth on http server?
@Basset Fauve de Bretagne sure <@743561772069421169>
jsx
<button onClick=(()=>{
router.push(resolveUrl("/home"));
})
have you tried this?
<button
onClick={() => {
window.location.href = "https://google.com";
}}
>@Ray have you tried this?
ts
<button
onClick={() => {
window.location.href = "https://google.com";
}}
>
Yellowhead catfish
whaa why do you need this i just wrap my buttons around an anchor element
@Yellowhead catfish whaa why do you need this i just wrap my buttons around an anchor element
I don't know I just use the code OP provided and try to debug his issue
Yellowhead catfish
oh alright
@Ray have you tried this?
ts
<button
onClick={() => {
window.location.href = "https://google.com";
}}
>
Basset Fauve de BretagneOP
I will try this, thank you!
@Yellowhead catfish whaa why do you need this i just wrap my buttons around an anchor element
Basset Fauve de BretagneOP
Oh, this is not the only purpose the button does, it also has other functionalities before routing. I just posted the code without those to simplify it
@Ray I don't know I just use the code OP provided and try to debug his issue
Yellowhead catfish
sorry for the ping do you think you could help me with #Image loading delayed its ok if not i just need help desperately