{"record":{"id":"9a91cfe794713878","repo":"AlistGo/alist","slug":"signin-failed-s","errorCode":null,"errorMessage":"signin failed: %s","messagePattern":"signin failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/guangyapan/driver.go","lineNumber":648,"sourceCode":"\t\treturn fmt.Errorf(\"verify code failed: %s\", d.accountErr(step2.ErrorDesc, step2.Error, resp))\n\t}\n\n\tvar out tokenResp\n\tresp, err = d.accountClient.R().\n\t\tSetContext(ctx).\n\t\tSetBody(map[string]any{\n\t\t\t\"verification_code\":  d.VerifyCode,\n\t\t\t\"verification_token\": step2.VerificationToken,\n\t\t\t\"username\":           normalizePhoneE164(d.PhoneNumber),\n\t\t\t\"client_id\":          d.ClientID,\n\t\t}).\n\t\tSetResult(&out).\n\t\tPost(\"/v1/auth/signin\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.IsError() || out.Error != \"\" || strings.TrimSpace(out.AccessToken) == \"\" {\n\t\treturn fmt.Errorf(\"signin failed: %s\", d.accountErr(out.ErrorDesc, out.Error, resp))\n\t}\n\n\td.AccessToken = strings.TrimSpace(out.AccessToken)\n\td.RefreshToken = strings.TrimSpace(out.RefreshToken)\n\td.VerificationID = \"\"\n\t// One-time SMS code should not be reused after successful login.\n\td.VerifyCode = \"\"\n\top.MustSaveDriverStorage(d)\n\treturn nil\n}\n\nfunc (d *GuangYaPan) prepareSMSCode(ctx context.Context) error {\n\t// Explicit send action should always refresh verification_id.\n\td.VerificationID = \"\"\n\tif err := d.ensureCaptchaToken(ctx, false); err != nil {\n\t\treturn err\n\t}\n\tverificationID, err := d.requestVerificationID(ctx)","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/guangyapan/driver.go#L630-L666","documentation":"Final step of SMS login: POST verification_code + verification_token + username to /v1/auth/signin. Thrown when the response is an HTTP error, has an error field, or the returned AccessToken is empty. On success the driver stores tokens and clears the one-time VerifyCode; on failure nothing is persisted.","triggerScenarios":"signin called after a successful verify step but the provider rejects the signin (expired verification_token, username/phone mismatch after normalizePhoneE164, wrong client_id, or server-side error).","commonSituations":"Delay between verify and signin long enough that the verification_token expires; phone number normalized to E164 does not match the account; ClientID changed from the default; transient provider outage during login.","solutions":["Restart the full SMS login flow quickly: new code, immediate save.","Verify phone_number is in a format normalizePhoneE164 keeps intact (correct country code).","Check the embedded errMsg for hints (invalid token vs server error) and retry later for 5xx."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := d.loginBySMSCode(ctx); err != nil {\n    if strings.Contains(err.Error(), \"signin failed\") {\n        // verification_token likely expired mid-flow; restart from code request\n        return d.loginBySMSCode(ctx) // only after fetching a fresh code\n    }\n    return err\n}","preventionTips":["Automate the whole SMS flow in one quick sequence (request code -> submit).","Keep phone_number in the exact format the account was registered with."],"tags":["auth","sms-login","signin","guangyapan"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}