A thihing(k) about the Login.

JPRuehmann
A thihing(k) about the Login.
JPRuehmann Tuesday 9th March 2021, 10:30:28

Hello

I am the only one that feels confused about the Login Scheme (USER@PASSWORD)?
The URL Scheme says PROTOCOL://USER:PASSWORD@HOST:PORT/PATH
So the Login Scheme could be mistaken with a eMail address for example,
I think it would be clearer if the scheme would be at least USER:PASSWORD to keep it in the Internet Standards.

Thanks,

Replies 8
Fred
Fred  Tuesday 9th March 2021, 16:21:16

  • Before ask a question, read the documentation.
  • 🎉  Featured as #1 product of the day on Product Hunt
  • Please like in alternativeto.net 👍🏻
  • ╰☆╮Flatboard╰☆╮ is a open source and community contributions are essential to project success!
  • <TextField>, my new CMS project designed by a passionate developer, for developers!
  • My last project Fast⚡︎CMS, a Flat-File cms.
  • I am currently busy 😫.

JPRuehmann
JPRuehmann  Tuesday 9th March 2021, 18:07:31

Sorry, that is one point why I dont entered it as Bug or Question too.
By the Way I don´t understand what these two things have to do with each other.
And the other Question is solved by the actual Login Scheme.
The only point I am setting is that an ":" would be less confusing than an "@" at that point.
But this is only a thinking of mine it is no Feature Request too.

Fred
Fred  Tuesday 9th March 2021, 21:20:46

Ho ok alright I understand.
In fact at the beginning Flatboard used this identification format: Pseudo#Password but it was problematic for regex in PHP.

Last modified by Fred on Tuesday 9th March 2021, 21:21:00
  • Before ask a question, read the documentation.
  • 🎉  Featured as #1 product of the day on Product Hunt
  • Please like in alternativeto.net 👍🏻
  • ╰☆╮Flatboard╰☆╮ is a open source and community contributions are essential to project success!
  • <TextField>, my new CMS project designed by a passionate developer, for developers!
  • My last project Fast⚡︎CMS, a Flat-File cms.
  • I am currently busy 😫.

JPRuehmann
JPRuehmann  Wednesday 10th March 2021, 09:07:20

Yes, RegEx is a bitch, not only in PHP.

shoaiyb
shoaiyb@b4cd1e7b  Wednesday 14th June 2023, 12:42:06

  I know this discussion is dead, but I gotta prove you wrong, RegExp isn't that bad. At least not for me.

They could have parse it like below:

<?php

$regexp = '|^(?<username>[\w]+?)#(?<password>[\w]+?)$';


Last modified by shoaiyb@b4cd1e7b on Wednesday 14th June 2023, 12:42:00

SurveyBuilder-Admin
SurveyBuilder-Admin  Wednesday 14th June 2023, 12:55:29

  Actually, that's not going to work, you would have to write it as this

* You have to remove the ^ that means that is the start of the RegExp, since you have an altercation before that, everything will work, even incorrect syntax.
* Named group name, don't work for all browsers.

This will be the correct RegExp for what your looking for
^([\w]+?)\#([\w]+?)$
or
|([\w]+?)\#([\w]+?)$

You can check your RegExp here

Last modified by SurveyBuilder-Admin on Wednesday 14th June 2023, 12:56:00
Software engineer, creates plugins for Flatboard, checks source codes, and answers any software errors questions and contributes on the GitHub page as well

shoaiyb
shoaiyb@b4cd1e7b  Wednesday 14th June 2023, 22:00:36

  Yeah, the ^ should be removed when the input isn't just the username#password format.
But, named group RegExp will work. RegExp was not meant for browsers, but rather programming languages, and PHP uses PCRE which support named capturing group.
You know most of the programming languages have their own RegExp parsers, and you should really consider using https://regex101.com to check RegExp that you are going to use for PHP. It supports many languages (called Flavors), Like JavaScript RegExp Parser, PHP RegExp Parser, Python, Golang, .Net and many more...

Anyway, I found out that I should escape the # character even if not using it as the delimiter, so the updated RegExp should be: ^(?<username>[\w]+?)\#(?<password>[\w]+?)$

Last modified by shoaiyb@b4cd1e7b on Wednesday 14th June 2023, 22:02:00

SurveyBuilder-Admin
SurveyBuilder-Admin  Thursday 15th June 2023, 03:46:50

I don't really use name groups because it just uses more space, then is should be, but if it works go for it 😊.
Software engineer, creates plugins for Flatboard, checks source codes, and answers any software errors questions and contributes on the GitHub page as well