Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procedural implementation of authentication and registration logic, backed by simplistic json-file storage #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ocramius
Copy link
Member

No description provided.

@Ocramius Ocramius added the enhancement New feature or request label Oct 25, 2018
@Ocramius Ocramius changed the title Procedural implementation of log-in and log-out logic, backed by simplistic json-file storage Procedural implementation of authentication and registration logic, backed by simplistic json-file storage Oct 25, 2018
$user = $_POST['emailAddress'];
$password = $_POST['password'];

$existingUsers = json_decode(file_get_contents(__DIR__ . '/../data/users.json'), true);
Copy link
Member Author

@Ocramius Ocramius Oct 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The storage is a simple file containing data in a format like:

{
   "me@example.com": "p@$$w0rdHa$h",
   "someone-else@example.com": "p@$$w0rdHa$h"
}


$existingUsers[$email] = $hash;

error_log('Registration mail sent here');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error_log() is a sufficient replacement for simulating I/O here, since we're writing to the terminal output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant