最近因为手机恢复了一下出厂设置,导致使用的‎Microsoft Authenticator数据丢失了。

今天登录 Halo 后台的时候要求输入两步验证的密码,这不就寄了嘛!

通过一番查找,发现官方已经给出了答案了。

https://bbs.halo.run/d/5735-%E4%BA%8C%E6%AC%A1%E9%AA%8C%E8%AF%81%E8%AE%BE%E5%A4%87%E4%B8%A2%E4%BA%86%E6%97%A0%E6%B3%95%E8%8E%B7%E5%8F%96%E9%AA%8C%E8%AF%81%E7%A0%81%E7%99%BB%E5%BD%95%E5%90%8E%E5%8F%B0

我是通过 Docker compose 部署的,停止容器后在 docker-compose.yml 中加入下面的代码即可:

- --halo.security.two-factor-auth.disabled=true

比如我的 YAML 代码的这一片段为:

command:
      - --spring.r2dbc.url=r2dbc:pool:postgresql://halodb/halo
      - --spring.r2dbc.username=halo
      - --spring.r2dbc.password=openpostgresql
      - --spring.sql.init.platform=postgresql
      - --halo.external-url=https://www.glaube-ty.top
      - --halo.security.two-factor-auth.disabled=true  #加入这一行

随后重新构建即可。

进入后台后再重置一下两步验证设备。