{"id":37266033,"url":"https://github.com/flextype-components/token","last_synced_at":"2026-01-16T00:32:00.509Z","repository":{"id":62505546,"uuid":"43695350","full_name":"flextype-components/token","owner":"flextype-components","description":"The Token component generate and store a unique token which can be used to help prevent","archived":false,"fork":false,"pushed_at":"2018-07-09T23:02:15.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T15:39:45.474Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flextype-components.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-05T15:43:34.000Z","updated_at":"2018-07-05T12:27:25.000Z","dependencies_parsed_at":"2022-11-02T12:45:43.828Z","dependency_job_id":null,"html_url":"https://github.com/flextype-components/token","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/flextype-components/token","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flextype-components%2Ftoken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flextype-components%2Ftoken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flextype-components%2Ftoken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flextype-components%2Ftoken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flextype-components","download_url":"https://codeload.github.com/flextype-components/token/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flextype-components%2Ftoken/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-16T00:31:59.975Z","updated_at":"2026-01-16T00:32:00.501Z","avatar_url":"https://github.com/flextype-components.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Token Component\n![version](https://img.shields.io/badge/version-1.2.0-brightgreen.svg?style=flat-square \"Version\")\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flextype-components/token/blob/master/LICENSE)\n\nThe Token component generate and store a unique token which can be used to help prevent [CSRF](http://wikipedia.org/wiki/Cross_Site_Request_Forgery) attacks.   \n\n### Installation\n\n```\ncomposer require flextype-components/token\n```\n\n### Usage\n\nGenerate token\n```php\nuse Flextype\\Component\\Token\\Token;\n\n$token = Token::generate();\n```\n\nGenerate token in the template\n```php\n\u003c?php use Flextype\\Component\\Token\\Token; ?\u003e\n\u003cinput type=\"hidden\" name=\"csrf\" value=\"\u003c?php echo Token::generate(); ?\u003e\"\u003e\n```\n\nCheck that the given token matches the currently stored security token.  \n```php\nuse Flextype\\Component\\Token\\Token;\n\nif (Token::check($token)) {\n    // Pass\n}\n```\n\n## License\nSee [LICENSE](https://github.com/flextype-components/token/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflextype-components%2Ftoken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflextype-components%2Ftoken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflextype-components%2Ftoken/lists"}