{"record":{"id":"fd347dbc1d269f80","repo":"larksuite/cli","slug":"app-registration-denied-by-user","errorCode":null,"errorMessage":"app registration denied by user","messagePattern":"app registration denied by user","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/app_registration.go","lineNumber":22,"sourceCode":"package auth\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/larksuite/cli/internal/core\"\n)\n\n// Terminal registration outcomes, exposed for typed classification by callers.\nvar (\n\tErrRegistrationDenied   = errors.New(\"app registration denied by user\")\n\tErrRegistrationExpired  = errors.New(\"device code expired, please try again\")\n\tErrRegistrationTimedOut = errors.New(\"app registration timed out, please try again\")\n)\n\n// Protocol defaults, mirroring the official SDK registration flow.\nconst (\n\tregistrationBootstrapBrand = core.BrandFeishu\n\tdefaultPollIntervalSeconds = 5\n\tdefaultExpireInSeconds     = 600\n\tbeginRequestTimeout        = 30 * time.Second\n\tmaxPollIntervalSeconds     = 60\n)\n\n// normalizedInterval clamps a non-positive poll interval to the protocol default.\nfunc normalizedInterval(v int) int {\n\tif v <= 0 {\n\t\treturn defaultPollIntervalSeconds\n\t}","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/auth/app_registration.go#L4-L40","documentation":"Terminal outcome sentinel of the device-code app registration flow: the authorization request was delivered but the user explicitly rejected it, so the poll loop stops with this error instead of continuing. Exposed so callers such as config init can classify denial distinctly from expiry and timeout.","triggerScenarios":"Thrown at internal/auth/app_registration.go:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run `lark-cli config init --new` and approve the authorization request when prompted"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}