{"id":17474149,"url":"https://github.com/ghostffcode/passwordless_login","last_synced_at":"2025-04-22T10:39:00.368Z","repository":{"id":81390223,"uuid":"57906069","full_name":"ghostffcode/passwordless_login","owner":"ghostffcode","description":":pizza: Login without password in PHP","archived":false,"fork":false,"pushed_at":"2016-05-04T20:56:50.000Z","size":25,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T10:38:34.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostffcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-02T17:04:03.000Z","updated_at":"2023-08-09T09:35:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"7be0b15c-b1cc-4573-959d-0e156a1c1185","html_url":"https://github.com/ghostffcode/passwordless_login","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Fpasswordless_login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Fpasswordless_login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Fpasswordless_login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Fpasswordless_login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostffcode","download_url":"https://codeload.github.com/ghostffcode/passwordless_login/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250222060,"owners_count":21394809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-18T18:08:34.647Z","updated_at":"2025-04-22T10:39:00.351Z","avatar_url":"https://github.com/ghostffcode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# passwordless Login\nSimple php passwordless login system\n\n## How to use\n\n### Send code to email and create session\n```php\n\u003c?php\n// include class file to your working script\ninclude 'inc/passwordless.php';\n\n// Create an instance of the passwordless class.\n// It takes three arguments\n// First one is what format to present results, which can be either json or array. Defaults to json if no argument is passed.\n// Second argument specifies running environment, can be 'dev' for development or 'prod' for production\n// Third argument is if you want to return passphrase in result, can either be true or false. (optional)\n$p = new passwordless('json','dev', false);\n\n// To send code to email and create session\n// sendCode() method handles email validation too\n$p-\u003esendCode('trial@example.com');  // pass email as argument to sendCode() method\n?\u003e\n```\n\n### Verify code that user enters\n```php\n$code = 23456;\n$trial = 5;\n// Add user code to validate() method\n// Takes two arguments\n// First is code from the user email\n// Second argument (optional) is number of login trials. Default is 3 trials\n$p-\u003evalidate($code [, $trial]); //will log user in if successful\n```\n\n### Check if user is logged in\nYou have to use this in every page that user must be logged in to view\n```php\n// returns true if user is logged in and false if not logged in\n$p-\u003eloggedIn();\n```\n\n### To log out and destroy session\n```php\n// This will log user out and redirect to homepage (index.php)\n// You can pass in redirect location as argument\n// Use this to logout and redirect to index.php\n$p-\u003elogOut();\n\n// Use this to logout and redirect to nice.php\n$p-\u003elogOut('nice.php');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostffcode%2Fpasswordless_login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostffcode%2Fpasswordless_login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostffcode%2Fpasswordless_login/lists"}