Giter Club home page Giter Club logo

Comments (9)

rmb122 avatar rmb122 commented on July 19, 2024

docker 里面有个 change_pass.py, docker exec 进去可以更改密码

from xss-receiver.

dd404x avatar dd404x commented on July 19, 2024

image
好像不行,还是报密码错误

from xss-receiver.

dd404x avatar dd404x commented on July 19, 2024

image
这么改的

from xss-receiver.

dd404x avatar dd404x commented on July 19, 2024

怎么修改可以不使用密码登录,直接进入后台

from xss-receiver.

rmb122 avatar rmb122 commented on July 19, 2024

判断密码的逻辑在这里 https://github.com/rmb122/xss-receiver/blob/master/xss_receiver/controllers/AuthController.py#L21, 你可以改成

@auth_controller.route("/login", methods=['POST'])
def login():
    if isinstance(request.json, dict):
        password = request.json.get('password', None)
        username = request.json.get('username', None)

        if isinstance(username, str) and isinstance(password, str) and True:
            token = sign_token().decode()
            system_log = SystemLog(log_content=f'Admin login with username [{username}]')
            db.session.add(system_log)
            db.session.commit()
            return jsonify(Response.success('登录成功', token))
        else:
            return jsonify(Response.failed('用户名或密码错误'))
    else:
        return jsonify(Response.invalid('无效请求'))

就可以不需要密码了

from xss-receiver.

rmb122 avatar rmb122 commented on July 19, 2024

改完密码需要重启一下 docker 才会生效, 忘了说了...

from xss-receiver.

dd404x avatar dd404x commented on July 19, 2024

image
image
image不知道什么原因,我已经更改代码逻辑而且重启了,但还是报错账号或密码错误, 按理说也应该 报错用户名或密码错误呀。我甚至删除了镜像重新构建也还是这个错误

from xss-receiver.

rmb122 avatar rmb122 commented on July 19, 2024

我本地复现了下, 现在已经修复了这个 bug. 原因是上游 PyJWT 更改了 api 返回的类型.
jpadilla/pyjwt@5d33b04
在之前 sign token 返回的是 bytes 类型, 最近的一次更新直接 str 了... 所以导致中间报错了, 所以把 .decode() 删掉就好了

from xss-receiver.

dd404x avatar dd404x commented on July 19, 2024

好的,谢谢师傅

from xss-receiver.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.