{"record":{"id":"2e3765cd8ba73704","repo":"m1k1o/neko","slug":"noauth-mode-does-not-have-password","errorCode":null,"errorMessage":"noauth mode does not have password","messagePattern":"noauth mode does not have password","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/member/noauth/provider.go","lineNumber":62,"sourceCode":"\t}\n\n\t// id is username with token\n\tid := fmt.Sprintf(\"%s-%s\", username, token)\n\n\tprovider.profile.Name = username\n\treturn id, provider.profile, nil\n}\n\nfunc (provider *MemberProviderCtx) Insert(username string, password string, profile types.MemberProfile) (string, error) {\n\treturn \"\", errors.New(\"new user is created on first login in noauth mode\")\n}\n\nfunc (provider *MemberProviderCtx) UpdateProfile(id string, profile types.MemberProfile) error {\n\treturn nil\n}\n\nfunc (provider *MemberProviderCtx) UpdatePassword(id string, password string) error {\n\treturn errors.New(\"noauth mode does not have password\")\n}\n\nfunc (provider *MemberProviderCtx) Select(id string) (types.MemberProfile, error) {\n\treturn types.MemberProfile{}, errors.New(\"cannot select user in noauth mode\")\n}\n\nfunc (provider *MemberProviderCtx) SelectAll(limit int, offset int) (map[string]types.MemberProfile, error) {\n\treturn map[string]types.MemberProfile{}, nil\n}\n\nfunc (provider *MemberProviderCtx) Delete(id string) error {\n\treturn errors.New(\"cannot delete user in noauth mode\")\n}\n","sourceCodeStart":44,"sourceCodeEnd":76,"githubUrl":"https://github.com/m1k1o/neko/blob/b0f01cedea68893e85a3fd852c0521238c285695/server/internal/member/noauth/provider.go#L44-L76","documentation":"In noauth mode there are no passwords at all: everyone connects as the single anonymous user. UpdatePassword() is a stub that always returns this error to indicate the concept of a password does not exist in this mode.","triggerScenarios":"Any call to the member UpdatePassword API (password-change endpoint) while the member provider is 'noauth'.","commonSituations":"A client or admin UI offers a 'change password' form against a noauth deployment; the call always fails because noauth has no credentials to change.","solutions":["Do not expose or call password-change functionality in noauth mode.","Switch to multiuser (or another provider) if password management is required.","Hide the password UI when the deployment reports noauth mode."],"exampleFix":"// before\nerr := memberClient.UpdatePassword(id, newPassword)\n\n// after\nif memberProvider == \"noauth\" {\n    return errors.New(\"passwords are not used in noauth mode\")\n}\nerr := memberClient.UpdatePassword(id, newPassword)","handlingStrategy":"validation","validationCode":"if memberProvider == \"noauth\" {\n    return errors.New(\"noauth mode has no passwords\")\n}\nerr := memberClient.UpdatePassword(id, newPassword)","typeGuard":"func isNoauthUnsupportedErr(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"in noauth mode\")\n}","tryCatchPattern":"err := memberClient.UpdatePassword(id, newPassword)\nif err != nil {\n    if isNoauthUnsupportedErr(err) {\n        log.Printf(\"noauth mode: passwords not applicable: %v\", err)\n    }\n    return err\n}","preventionTips":["Never offer password UI on noauth deployments.","Check the provider type before any credential-related API call.","Remember noauth authenticates everyone as the same anonymous user.","Switch providers if credential management becomes a requirement."],"tags":["noauth","members","password","unsupported-operation"],"backgroundTag":"unsupported-operation-mode","analyzedSha":"b0f01cedea68893e85a3fd852c0521238c285695","analyzedAt":"2026-09-01T10:35:56.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}