Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Invited non-admin users cannot set their password: set-password requires 'create user' permission

未关闭 适合新手
#263 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
90/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php

调研方向

从 Fleetbase\Http\Controllers\Internal\v1\UserController::setCurrentUserPassword() 开始,将其授权属性与当前用户相关的同级 endpoint(例如 changeCurrentUserEmail 和 acceptCompanyInvite)进行比较。验证已认证的受邀非管理员用户设置密码的请求不再需要创建用户权限,并且能够成功完成。

由索引模型根据 Issue 内容生成。

描述

Summary

Fleetbase\Http\Controllers\Internal\v1\UserController::setCurrentUserPassword() (POST /int/v1/users/set-password) is missing the #[SkipAuthorizationCheck] attribute that its sibling "current user" endpoints have (changeCurrentUserEmail, acceptCompanyInvite, setUserLocale, …). The authorization layer therefore applies the default permission for a POST on users, which is create user.

Impact

A newly invited user who is not an administrator cannot set their initial password. After accepting the invitation, the console opens the "Set a new password" modal (needs_password: true), and saving it fails with:

User is not authorized to create user

The modal has no close/decline button, so the user is stuck. Administrators are not affected because they hold the create user permission, which hides the bug.

Versions

Fleetbase v0.7.63 (core-api v1.6.62).

Reproduction

  1. IAM → Users → invite a new user with a non-admin role (e.g. Operations Manager from Fleet-Ops).
  2. Accept the invitation from the email.
  3. Enter and confirm a password in the "Set a new password" modal → POST /int/v1/users/set-password → error "User is not authorized to create user".

Suggested fix

#[SkipAuthorizationCheck]
public function setCurrentUserPassword(UpdatePasswordRequest $request)

The method only acts on $request->user(), so it needs authentication but no IAM permission.

Workaround

The invited user (already active after accepting) uses "Forgot your password?" on the login page to set the password by email.

主要语言
PHP
星标
17
派生
39
平均合并
1 天 8 小时
30 天内合并 PR
18

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fleetbase/core-api 的其他 Issue

查看 fleetbase/core-api 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。