Permalink
Browse files

Resolve #52 User should not be able to add a domain with uppercase

  • Loading branch information...
bgornicki committed Nov 25, 2018
1 parent 335bbfb commit 82bfb49cef06e3b74e38d363e99be7c42eec7563
@@ -21,4 +21,12 @@
.parsley-success:focus {
border: 5px solid #ddffdd;
background-color: #ddffdd;
}

#custom-domain {
text-transform: lowercase;
}

#configuration-domain {
text-transform: lowercase;
}
@@ -54,7 +54,7 @@ export class SSLModule {
try {
if (await SSLModule.checkIfDomainPointsEngraveServer(blog.domain) &&
await SSLModule.checkIfDomainPointsEngraveServer('www.' + blog.domain)) {
console.log("Unsecured blog: ", blog.domain);
console.log("Unsecured blog: ", blog.domain, "from @" + blog.steem_username);
await SSLModule.generateCertificatesForDomain(blog.domain);
console.log(" * SSL generated for ", blog.domain);
NginxModule.generateNginxSettings(blog);
@@ -9,8 +9,9 @@ const router = express.Router();
router.get('/', async (req: IExtendedRequest, res: express.Response, next: express.NextFunction) => {
if (!req.query.access_token) {
if (req.query.blog) {
if (await BlogListModule.isBlogRegistered(req.query.blog)) {
req.session.blog_redirect = req.query.blog;
const blogDomain = req.query.blog.toLowerCase();
if (await BlogListModule.isBlogRegistered(blogDomain)) {
req.session.blog_redirect = blogDomain;
const uri = ReaderSteemConnect.getLoginURL();
res.redirect(uri);
} else {
@@ -37,9 +37,9 @@ router.post(

try {
let configuration = req.body;
let domain = configuration.domain;
let domain = configuration.domain.toLowerCase();
if (configuration.subdomain) {
domain = configuration.subdomain + "." + configuration.domain;
domain = configuration.subdomain.toLowerCase() + "." + configuration.domain.toLowerCase();
}

let available = await BlogListModule.isBlogDomainAvailable(domain);
@@ -14,7 +14,7 @@ router.get('/', async (req: IExtendedRequest, res: express.Response, next: expre
router.post('/check', async (req: IExtendedRequest, res: express.Response, next: express.NextFunction) => {

try {
const domain = req.body.domain;
const domain = req.body.domain.toLowerCase();

Domains.validateCustomDomain(domain);

@@ -35,7 +35,7 @@ router.post('/check', async (req: IExtendedRequest, res: express.Response, next:
router.post('/choose', async (req: IExtendedRequest, res: express.Response, next: express.NextFunction) => {

try {
const domain = req.body.domain;
const domain = req.body.domain.toLowerCase();;
const currency = req.body.currency;

Domains.validateCustomDomain(domain);
@@ -3,7 +3,7 @@ form#configure
.col-md-6
.form-group
label Blog address
input.form-control.text-right(name='subdomain', required, pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]{2,24}?$", title="Use no special characters and whitespaces. Allowed length: 2-24 characters", type='text', placeholder='yourblogaddress')
input.form-control.text-right#configuration-domain(name='subdomain', autocapitalize="none", required, pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]{2,24}?$", title="Use no special characters and whitespaces. Allowed length: 2-24 characters", type='text', placeholder='yourblogaddress')

.col-md-6
.form-group
@@ -5,7 +5,7 @@ if !blogger.domain || blogger.domain == ''
p Type your preffered domain and if it's free you can pay for using it. You will be redirected to Steemconnect website to approve transfer. Domain will be registered for 1 year. Renewal price may vary.
p Available extensions: <strong>.rocks</strong>, <strong>.xyz</strong>, <strong>.world</strong>, <strong>.space</strong>, <strong>.site</strong>, <strong>.website</strong>, <strong>.me</strong>, <strong>.eu</strong>, <strong>.com</strong>, <strong>.org</strong>, <strong>.buzz</strong>, <strong>.net</strong>
label Domain
input.form-control#custom-domain(name='domain', pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$", type='text', placeholder='example.com', value='' parsley-trigger="change" required)
input.form-control#custom-domain(name='domain', autocapitalize="none", pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$", type='text', placeholder='example.com', value='' parsley-trigger="change" required)

a(href='/authorize/tier/cancel').btn.btn-link Change your tier
button.btn.btn-success.btn-fill.pull-right#pay-steem(type='submit')= 'Pay ' + domainPrice.steem + ' STEEM'
@@ -9,7 +9,7 @@ form#configure
.col-md-12
.form-group
label Domain
input.form-control(name='domain', pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$", type='text', placeholder='example.com', value='' parsley-trigger="change" required)
input.form-control(name='domain', autocapitalize="none", pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]+\.[a-zA-Z]{2,11}?$", type='text', placeholder='example.com', value='' parsley-trigger="change" required)
.row
.col-md-6
.form-group

0 comments on commit 82bfb49

Please sign in to comment.