MyGit

backend/v1.0.0

teamhanko/hanko

版本发布时间: 2024-08-08 22:15:25

teamhanko/hanko最新发布版本:backend/v1.0.2(2024-08-28 21:14:06)

release1 0_small

We are excited to release Hanko 1.0 today. After two years in Beta, the new Hanko is more user-friendly, more customizable and more mature than all previous releases in almost all areas and finally deserves the 1.0 version number.

Highlights

Options, options, options

Usernames

Privacy

Dedicated login and registration flows

Introducing the all-new Flow API

This version contains a new API, which we call Flow API (#1532). With the previous RESTful API of the Hanko backend, it had become very complex to extend the functionality of Hanko. This was mainly due to the fact that most of the state handling was done in Hanko Elements and each endpoint had to be called in a specific order to work properly. The Flow API takes over this complexity completely in the backend and thus enables us to further develop the Hanko system at a higher speed than ever before.

New config options

Flow API supports much more granular settings to control the login and registration flows. The following is a sample configuration containing the most important new settings:


debug: false
convert_legacy_config: false

email:
  enabled: true
  optional: false
  acquire_on_registration: true
  acquire_on_login: true
  require_verification: true
  use_as_login_identifier: true
  use_for_authentication: true
  limit: 5
  max_length: 100
  passcode_ttl: 300

username:
  enabled: false
  optional: true
  acquire_on_registration: true
  acquire_on_login: false
  use_as_login_identifier: true
  min_length: 3
  max_length: 32

password:
  enabled: true
  optional: false
  acquire_on_registration: always
  acquire_on_login: never
  recovery: true
  min_length: 8

passkey:
  enabled: true
  optional: true
  acquire_on_registration: always
  acquire_on_login: always
  user_verification: preferred
  attestation_preference: direct
  limit: 10

Migration

Config

With the introduction of the new configuration parameters, some old parameters have become obsolete and the new parameters should be used in future if the default values are not sufficient (default values have not changed):

Old New
emails.max_num_of_addresses email.limit
emails.require_verification email.require_verification
passcode.ttl email.passcode_ttl
smtp email_delivery.smtp
passcode.email.from_name email_delivery.from_name
passcode.email.from_address email_delivery.from_address
password.min_password_length password.min_length
webauthn.user_verification passkey.user_verification
webauthn.timeout webauthn.timeouts.registration
webauthn.timeout webauthn.timeouts.login

Old config files can still be used, but the convert_legacy_config parameter must be set to true.

[!CAUTION] Some of the new configuration parameters are not compatible with older versions of Hanko Elements (< v1.0). To ensure smooth operation, Hanko Elements v1.0 or higher should be used with the new configuration parameters.

[!CAUTION] The new configuration parameters email.enabled, email.use_for_authentication and passkey.enabled also disable the REST API endpoints if set to false, but Hanko Elements before v1.0 does not know how to deal with that and will throw an error.

Frontend

Events

Check session state

The element will no longer check if a session has already been established, and the "You're already logged in" page has been removed. This change was necessary to enable re-authentication in future versions. You can check if a user is already logged in using the following code:

import {register} from "https://cdn.jsdelivr.net/npm/@teamhanko/hanko-elements/dist/elements.js"

const {hanko} = await register("https://...");

if (hanko.session.isValid()) {
	// user is already logged in
} else {
	// show auth component
}

What's Changed

New Contributors

Full Changelog: https://github.com/teamhanko/hanko/compare/backend/v0.12.0...backend/v1.0.0

相关地址:原始地址 下载(tar) 下载(zip)

1、 hanko_Darwin_arm64.tar.gz 8.85MB

2、 hanko_Darwin_x86_64.tar.gz 9.34MB

3、 hanko_Linux_arm64.tar.gz 8.43MB

4、 hanko_Linux_i386.tar.gz 8.51MB

5、 hanko_Linux_x86_64.tar.gz 9.11MB

6、 hanko_Windows_arm64.zip 8.53MB

7、 hanko_Windows_i386.zip 8.89MB

8、 hanko_Windows_x86_64.zip 9.36MB

查看:2024-08-08发行的版本