{"record":{"id":"ff03802509500e66","repo":"AlistGo/alist","slug":"invalid-or-expired-token","errorCode":null,"errorMessage":"Invalid or expired token","messagePattern":"Invalid or expired token","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"drivers/proton_drive/util.go","lineNumber":181,"sourceCode":"\t\tHandler: mux,\n\t}\n\n\tgo func() {\n\t\td.tempServer.Serve(listener)\n\t}()\n\n\treturn nil\n}\n\nfunc (d *ProtonDrive) handleTempDownload(w http.ResponseWriter, r *http.Request) {\n\ttoken := strings.TrimPrefix(r.URL.Path, \"/temp/\")\n\n\td.tokenMutex.RLock()\n\tinfo, exists := d.downloadTokens[token]\n\td.tokenMutex.RUnlock()\n\n\tif !exists {\n\t\thttp.Error(w, \"Invalid or expired token\", http.StatusNotFound)\n\t\treturn\n\t}\n\n\tlink, err := d.protonDrive.GetLink(r.Context(), info.LinkID)\n\tif err != nil {\n\t\thttp.Error(w, \"Failed to get file link\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Get file size for range calculations\n\t_, _, attrs, err := d.protonDrive.DownloadFile(r.Context(), link, 0)\n\tif err != nil {\n\t\thttp.Error(w, \"Failed to get file info\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tfileSize := attrs.Size\n","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/proton_drive/util.go#L163-L199","documentation":"Error \"Invalid or expired token\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/proton_drive/util.go:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid token in the storage configuration and save it again.","If the token expired, re-login or refresh it through the provider and update the configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}