druxt.js icon indicating copy to clipboard operation
druxt.js copied to clipboard

Investigate htaccess restricted backend.

Open Decipher opened this issue 5 years ago • 6 comments

Is your feature request related to a problem? Please describe. Support request via Discord mentioned they couldn’t access a htaccess restricted backend.

Describe the solution you'd like Test, confirm, and if valid, resolve issue.

Describe alternatives you've considered N/A

Additional context N/A

Decipher avatar Nov 05 '20 20:11 Decipher

Hi, our test backends / features are behind .htaccess. The domains for the features are created on gitlab ci. So when i just add the domain in my nuxt.config file i get an unauthorized error which is correct because i didnt set any credentials.

i tryed to install nuxt-auth and set the credentials with no luck so thats why i ask if there is any possibility to set the credentials and get that working.

I want to give someone our backend for testing and my code repository on github but the .htaccess should stay. So my question is: Is there a way (maybe in the druxt {} object beside the domain, where i can set credentials for .htaccess?)

shagel7984 avatar Nov 06 '20 08:11 shagel7984

It should be possible to set your Basic Auth headers doing something like this:

druxt: {
  axios: {
    headers: {}
  },
  baseUrl: ''
}

See here for more details: https://github.com/axios/axios#creating-an-instance

Decipher avatar Nov 06 '20 09:11 Decipher

Hi @Decipher ,

As I mentioned in the Slack channel, I tried this, but it's adding an "undefined" plugin entry for some reason. As a result, the Nuxt builder complains about it.

FYI: I have all the latest versions of Druxt and Nuxt.

CleanShot 2023-11-15 at 14 42 43

amjad1233 avatar Nov 15 '23 04:11 amjad1233

Sorry the versions are as below:

[email protected] ├─┬ [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └─┬ [email protected] │ └── [email protected] deduped └─┬ [email protected] ├── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped └─┬ [email protected] └── [email protected] deduped

amjad1233 avatar Nov 15 '23 05:11 amjad1233

├─┬ [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └─┬ [email protected] │ └── [email protected] deduped └─┬ [email protected] ├── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped └─┬ [email protected] └── [email protected] deduped

amjad1233 avatar Nov 15 '23 05:11 amjad1233

https://github.com/nuxt/nuxt/issues/24301 was the solution for me.

amjad1233 avatar Nov 15 '23 05:11 amjad1233