{"record":{"id":"db36fbd15201e2fb","repo":"AlistGo/alist","slug":"safepassword-is-incorrect","errorCode":null,"errorMessage":"SafePassword is incorrect ","messagePattern":"SafePassword is incorrect ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/thunder_browser/driver.go","lineNumber":663,"sourceCode":"\t}\n\treturn &resp, nil\n}\n\n// GetSafeAccessToken 获取 超级保险柜 AccessToken\nfunc (xc *XunLeiBrowserCommon) GetSafeAccessToken(safePassword string) (string, error) {\n\tvar resp TokenResp\n\t_, err := xc.Request(XLUSER_API_URL+\"/password/check\", http.MethodPost, func(req *resty.Request) {\n\t\treq.SetBody(&base.Json{\n\t\t\t\"scene\":    \"box\",\n\t\t\t\"password\": EncryptPassword(safePassword),\n\t\t})\n\t}, &resp)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif resp.Token == \"\" {\n\t\treturn \"\", errors.New(\"SafePassword is incorrect \")\n\t}\n\treturn resp.Token, nil\n}\n\n// Login 登录\nfunc (xc *XunLeiBrowserCommon) Login(username, password string) (*TokenResp, error) {\n\turl := XLUSER_API_URL + \"/auth/signin\"\n\terr := xc.RefreshCaptchaTokenInLogin(GetAction(http.MethodPost, url), username)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar resp TokenResp\n\t_, err = xc.Common.Request(url, http.MethodPost, func(req *resty.Request) {\n\t\treq.SetBody(&SignInRequest{\n\t\t\tCaptchaToken: xc.GetCaptchaToken(),\n\t\t\tClientID:     xc.ClientID,\n\t\t\tClientSecret: xc.ClientSecret,","sourceCodeStart":645,"sourceCodeEnd":681,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/thunder_browser/driver.go#L645-L681","documentation":"GetSafeAccessToken posts the encrypted safe-box password to XLUSER /password/check (scene=box); an empty Token in the response means the server rejected the password. The driver reports 'SafePassword is incorrect ' (trailing space included in the message) because an empty token is the only signal the check endpoint gives for a wrong password.","triggerScenarios":"Calling any safe-box (超级保险柜) operation while the SafePassword configured in the storage addition does not match the account's actual safe-box password; the /password/check response returns a body without a usable token.","commonSituations":"Safe-box password typo in the driver config; Safe-box password changed on the Xunlei account but not updated in alist; Safe box never enabled on the account, yet a password was set in config and safe-box paths requested","solutions":["Re-enter the exact safe-box password (the one used in the Xunlei client's 超级保险柜, which is distinct from the login password) in the storage settings","Confirm the safe box feature is enabled on the account and the password matches by opening it in the official client","Re-save the storage and retry the safe-box listing"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if strings.TrimSpace(xc.SafePassword) == \"\" {\n    return errors.New(\"safe-box password not configured; set it before accessing the safe box\")\n}\n// optionally pre-verify once at Init\ntok, err := xc.GetSafeAccessToken(xc.SafePassword)\nif err != nil { return fmt.Errorf(\"safe password check failed: %w\", err) }","typeGuard":null,"tryCatchPattern":"_, err := xc.GetSafeAccessToken(pwd)\nif err != nil && strings.HasPrefix(err.Error(), \"SafePassword is incorrect\") {\n    return errors.New(\"the configured safe-box password does not match this account — update it in storage settings\")\n}","preventionTips":["Store the safe-box password (distinct from login password) in a password manager","Verify the password once at storage save time, not on every safe-box operation","Confirm the safe box is enabled on the account before configuring access"],"tags":["thunder","xunlei","safe-box","password","auth"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}