Nuxt basic auth does not work on Firebase - firebase

I am working on a Nuxt project which is deployed on firebase. I have basic auth configuration set up using nuxt-basic-auth-module.
It works locally, but on firebase does not work which I do not why. Am I doing something wrong? Additional settings required? Please give me advices. Thank you very much.
nuxt.config.js
import colors from 'vuetify/es5/util/colors'
require('dotenv').config()
export default {
mode: 'universal',
head: {
titleTemplate: '%s - ' + process.env.npm_package_name,
title: process.env.npm_package_name || '',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
loading: { color: '#fff' },
buildModules: [
'#nuxtjs/vuetify',
'#nuxtjs/dotenv'
],
modules: [
'#nuxtjs/axios',
'#nuxtjs/proxy',
'nuxt-basic-auth-module'
],
build: {
extend (config, ctx) {
}
},
server: {
port: 4000, // default: 3000
host: '0.0.0.0' // default: localhost
},
env: {
baseUrl: process.env.BASE_URL
},
basic: {
name: 'basicauthusername',
pass: 'basicauthpasswrd1234'
}
}

As mentioned on documentation, enabled comes with false value by default
basic: {
name: 'basicauthusername',
pass: 'basicauthpasswrd1234'
enabled: true // Add this property
}

Related

Symfony - switch from php-ampqlib RabbitMQ bundle to messenger - which is the way?

I am trying to change switch to symfony messenger, but documentation doesnt show me way.
Lets have old configuration for php-ampqlib:
mail_queue:
connection: message
exchange_options: { name: 'mail_queue', type: direct }
queue_options: { name: 'mail_queue',arguments: { 'x-dead-letter-exchange': [ 'S', 'mail_queue_failed' ],'x-dead-letter-routing-key': [ 'S', '' ],'x-max-priority': [ 'I',10 ] } }
callback: AppBundle\Consumer\MailQueueConsumer
qos_options: { prefetch_size: 0, prefetch_count: 1, global: false }
mail_queue_failed:
connection: message
exchange_options: { name: 'mail_queue_failed', type: direct }
queue_options: { name: 'mail_queue_failed', arguments: { 'x-message-ttl': [ 'I', 20000 ], 'x-dead-letter-exchange': [ 'S', 'mail_queue' ],'x-dead-letter-routing-key': [ 'S', '' ] } }
callback: AppBundle\Consumer\DoingNothingConsumer
How is the same configuration for Symfony messenger? I have spended a lot of hours without success.
Thank you very much.
D

Redirect all traffic from a subdomain on NextJS

I want to redirect all traffic to my pricing page via a subdomain to my homepage. I can't figure out how to add wildcards in the has value.
This syntax does not work:
// next.config.js
module.exports = {
target: 'serverless',
async redirects() {
return [
{
source: '/pricing',
has: [
{
type: 'host',
value: '*.*.*',
},
],
permanent: false,
destination: 'https://example.com/'
}
]
},
}
Any ideas?
Vercel support helped me find the solution. I needed to update my regex in the value.
// next.config.js
module.exports = {
target: 'serverless',
async redirects() {
return [
{
source: '/pricing',
has: [
{
type: 'host',
value: '.*\\..*\\..*'
},
],
permanent: false,
destination: 'https://example.com/'
}
]
},
}
If you want to redirect the subdomain, you would add the redirect on that project. If you want the contents of the subdomain (e.g. pricing.example.com) to show up on a different project at /pricing, you would use a rewrite.
module.exports = {
async rewrites() {
return [
{
source: '/pricing',
destination: 'https://pricing.example.com'
},
]
},
}

I Couldn't change HTTP headers in a NextJS project

As explained in the NextJs documentation: https://nextjs.org/docs/api-reference/next.config.js/headers , it is possible to configure the HTTP headers of a page using the code below, however my code is not working.
Next Example:
module.exports = {
async headers() {
return [
{
source: '/about',
headers: [
{
key: 'x-custom-header',
value: 'my custom header value',
},
{
key: 'x-another-custom-header',
value: 'my other custom header value',
},
],
},
]
},
}
My Code:
module.exports = {
async headers() {
return [
{
source: '/about',
headers: [
{
key: 'cache-control',
value: 'max-age=31536000',
},
],
},
]
},
}

Sencha production build failed while using sqlitestorage

In app.js file i have added path of sqlite folder
Ext.Loader.setPath({
'Ext': 'touch/src',
'ConsultLite': 'app',
'Sqlite': 'sqlite'
});
My InitSQLite.js file is
Ext.define('ConsultLite.util.InitSQLite', {
singleton : true,
requires: [
'Sqlite.Connection',
'Sqlite.data.proxy.SqliteStorage',
'Ext.data.reader.Array'
],
initDb: function() {
Ext.ns('DbConnection');
this.DbConnection = Ext.create('Sqlite.Connection', {
dbName: 'ConsultLiteApp',
dbDescription: 'ConsultLiteApp Database',
dbVersion: '1.0',
dbSize: 200000,
});
},
getConnection: function() {
if(!Ext.isDefined(this.DbConnection)) this.initDb();
return this.DbConnection;
}
});
My Model file in which is i have used sqllite proxy
Ext.define('ConsultLite.model.Credential', {
extend: 'Ext.data.Model',
xtype: 'Credential',
config: {
fields: [
{ name : 'id', type : 'int' },
{ name: 'email', type: 'string'},
{ name: 'password', type: 'string'}
],
proxy: {
type: 'sqlitestorage',
dbConfig: {
tablename: 'credential',
dbConn: ConsultLite.util.InitSQLite.getConnection()
}
},
},
});
After executing sencha command "sencha app build production" above error come

Sench Touch List is not rendering the data

Ext.define('MyApp.model.Facility', {
extend: 'Ext.data.Model',
requires: [
'Ext.data.proxy.Ajax'
],
config: {
fields: [
{
name: 'FacilityId'
},
{
name: 'FacilityName'
}
]
}
});
Ext.define('MyApp.store.FacilityStore', {
extend: 'Ext.data.Store',
requires: [
'MyApp.model.Facility'
],
config: {
autoLoad: true,
model: 'MyApp.model.Facility',
storeId: 'FacilityStore',
proxy: {
type: 'ajax',
batchActions: false,
url: 'http://localhost/QuickFind/Services/EquipmentService.asmx/GetFacilities',
headers: {
'content-type': 'application/json'
},
reader: {
type: 'json',
rootProperty: 'd'
}
}
}
});
And trying the load the data into the list.
Ext.define('MyApp.view.facilityList', {
extend: 'Ext.dataview.List',
alias: 'widget.facilityList',
config: {
docked: 'top',
height: 200,
id: 'datalist',
ui: 'round',
scrollable: true,
store: 'FacilityStore',
onItemDisclosure: true,
itemTpl: [
'<div><p>{Facility.FacilityName}</p></div>'
]
}
});
and my controller launch i am binding the data to the list:
Ext.define('MyApp.controller.Facility', {
extend: 'Ext.app.Controller',
config: {
refs: {
dataList: '#dataList',
mainNav: 'mainNav'
}
},
launch: function() {
var me = this;
debugger;
Ext.getStore('FacilityStore').load();
var group_store = Ext.getStore("FacilityStore");
me.facilityList.setStore(group_store);
}
Store is loaded with records but it's not displaying in the list.
I hope u have solved ur problem by this moment,but still to answer the question u have posted..the problem is the itemtpl u have written..
ur's
itemTpl: [
'<div><p>{Facility.FacilityName}</p></div>'
]
The field u have mentioned is FacilityName so to get the record's from the store Facility
U just need to do this in ur itemtpl to get data in list:
itemTpl: [
'<div><p>{FacilityName}</p></div>'
]

Resources