{"id":30095586,"url":"https://github.com/gethinode/mod-hanko","last_synced_at":"2026-05-23T10:03:57.360Z","repository":{"id":308467844,"uuid":"1032908535","full_name":"gethinode/mod-hanko","owner":"gethinode","description":"A Hugo module to add authentication powered by Hanko to your Hinode site","archived":false,"fork":false,"pushed_at":"2025-10-03T07:30:47.000Z","size":837,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-03T09:23:05.164Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":false,"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/gethinode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-06T02:47:56.000Z","updated_at":"2025-10-03T07:30:46.000Z","dependencies_parsed_at":"2025-08-26T16:39:59.621Z","dependency_job_id":"a9438b8f-9c2e-43b6-b0a9-06e02d7b5684","html_url":"https://github.com/gethinode/mod-hanko","commit_stats":null,"previous_names":["gethinode/mod-hanko"],"tags_count":8,"template":false,"template_full_name":"gethinode/mod-template","purl":"pkg:github/gethinode/mod-hanko","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethinode%2Fmod-hanko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethinode%2Fmod-hanko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethinode%2Fmod-hanko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethinode%2Fmod-hanko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gethinode","download_url":"https://codeload.github.com/gethinode/mod-hanko/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethinode%2Fmod-hanko/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278956330,"owners_count":26075221,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-08-09T11:17:33.816Z","updated_at":"2026-05-23T10:03:57.353Z","avatar_url":"https://github.com/gethinode.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hinode Module - Hanko\n\n\u003c!-- Tagline --\u003e\n\u003cp align=\"center\"\u003e\n    \u003cb\u003eA Hugo module to add authentication powered by Hanko to your Hinode site\u003c/b\u003e\n    \u003cbr /\u003e\n\u003c/p\u003e\n\n\u003c!-- Badges --\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://gohugo.io\" alt=\"Hugo website\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/generator-hugo-brightgreen\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://gethinode.com\" alt=\"Hinode theme\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/theme-hinode-blue\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gethinode/mod-hanko/commits/main\" alt=\"Last commit\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/last-commit/gethinode/mod-hanko.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gethinode/mod-hanko/issues\" alt=\"Issues\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/issues/gethinode/mod-hanko.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gethinode/mod-hanko/pulls\" alt=\"Pulls\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/issues-pr-raw/gethinode/mod-hanko.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gethinode/mod-hanko/blob/main/LICENSE\" alt=\"License\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/gethinode/mod-hanko\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\n![Logo](https://raw.githubusercontent.com/gethinode/hinode/main/static/img/logo.png)\n\nHinode is a clean blog theme for [Hugo][hugo], an open-source static site generator. Hinode is available as a [template][repository_template], and a [main theme][repository]. This repository maintains a Hugo module to add authentication powered by [Hanko](https://hanko.io) to a Hinode site. Visit the Hinode documentation site for addtional [installation instructions][hinode_docs]. This module requires a Hanko account, check out the [Hanko docs](https://docs.hanko.io/setup-hanko-cloud) to get you started.\n\n## Contributing\n\nThis module uses [semantic-release][semantic-release] to automate the release of new versions. The package uses `husky` and `commitlint` to ensure commit messages adhere to the [Conventional Commits][conventionalcommits] specification. You can run `npx git-cz` from the terminal to help prepare the commit message.\n\n## Configuration\n\nA login template is available in the `layouts` folder, which is automatically mounted into your site. You can reference this template by setting `layout: login` in the frontmatter of your content page. When the parameter `authenticate` is set to true, the login page will include the [Hanko Auth Component](https://docs.hanko.io/guides/hanko-elements/auth-component). The [Login Component](https://docs.hanko.io/guides/hanko-elements/login-component) is included instead. For example, create a login page `content/login.md` with the following content.\n\n```yml\n---\ntitle: Login\ndescription: Login page\nlayout: login\nparams:\n  authenticate: false\n---\n```\n\nThis module supports the following parameters (see the section `params.modules` in `config.toml`):\n\n| Setting                   | Default | Description |\n|---------------------------|---------|-------------|\n| endpoint                  |         | Hanko API URL, such as `https://f4****-4802-49ad-8e0b-3d3****ab32.hanko.io`. Check the [Hanko console](https://cloud.hanko.io/) to retrieve the value. |\n| login-redirect            |         | Redirect destination after a successful login, e.g. `/` to redirect to the site's homepage. |\n| logout-redirect           |         | Redirect destination after a successful logout, e.g. `/login/` to redirect to the login page. |\n| timeout-redirect          |         | Redirect destination when the session has expired, e.g. `/login/` to redirect to the login page. A modal dialog is shown to confirm the redirect. |\n\nWhen using Content Security Policies, be sure to add the endpoint to the `connect-src` safelist. For example, the following configuration in your site parameters will enable connections to the example Hanko API URL.\n\n```toml\n[modules.hanko.csp]\n    connect-src = [\n        \"f4****-4802-49ad-8e0b-3d3****ab32.hanko.io\"\n    ]\n```\n\n## Session Lifecycle Events\n\nThe module dispatches `CustomEvent` notifications on `document` at key\npoints in the Hanko session lifecycle so consumers can run additional\ncleanup or bootstrap logic without forking the module. All events are\nnon-cancelable and carry no `detail` payload — listeners are notifications,\nnot interceptors. Any async work a listener kicks off (`fetch` with\n`keepalive`, etc.) must outlive the subsequent redirect on its own.\n\n| Event                  | Fires when                                                                 |\n|------------------------|----------------------------------------------------------------------------|\n| `hanko:sessionCreated` | A new Hanko session was established, before redirect to `login-redirect`.  |\n| `hanko:sessionExpired` | The session has expired, before the timeout modal is rendered.             |\n| `hanko:beforeLogout`   | The user clicked `#logout-link`, before `hanko.user.logout()` is invoked.  |\n| `hanko:afterLogout`    | Hanko reports a successful logout, before redirect to `logout-redirect`.   |\n\nExample — flushing site-specific cookies on logout:\n\n```js\ndocument.addEventListener('hanko:beforeLogout', () =\u003e {\n    fetch('/your-app/logout', { method: 'POST', keepalive: true })\n})\ndocument.addEventListener('hanko:sessionExpired', () =\u003e {\n    fetch('/your-app/logout', { method: 'POST', keepalive: true })\n})\n```\n\n\u003c!-- MARKDOWN LINKS --\u003e\n[hugo]: https://gohugo.io\n[hinode_docs]: https://gethinode.com\n[repository]: https://github.com/gethinode/hinode.git\n[repository_template]: https://github.com/gethinode/template.git\n[conventionalcommits]: https://www.conventionalcommits.org\n[husky]: https://typicode.github.io/husky/\n[semantic-release]: https://semantic-release.gitbook.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgethinode%2Fmod-hanko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgethinode%2Fmod-hanko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgethinode%2Fmod-hanko/lists"}