{"record":{"id":"dd99e809e63d0ed4","repo":"m1k1o/neko","slug":"new-user-is-created-on-first-login-in-noauth-mode","errorCode":null,"errorMessage":"new user is created on first login in noauth mode","messagePattern":"new user is created on first login in noauth mode","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/member/noauth/provider.go","lineNumber":54,"sourceCode":"\treturn nil\n}\n\nfunc (provider *MemberProviderCtx) Authenticate(username string, password string) (string, types.MemberProfile, error) {\n\t// generate random token\n\ttoken, err := utils.NewUID(5)\n\tif err != nil {\n\t\treturn \"\", types.MemberProfile{}, err\n\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","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/m1k1o/neko/blob/b0f01cedea68893e85a3fd852c0521238c285695/server/internal/member/noauth/provider.go#L36-L72","documentation":"In noauth mode there is a single anonymous profile auto-created on first connection; there is no user store. Insert() is unsupported by design and always returns this error, because no new users can exist in noauth mode.","triggerScenarios":"Any call to the member Insert API (create-user endpoint) while the server runs with member provider 'noauth'.","commonSituations":"Generic admin tooling that creates users against any neko deployment hits a noauth (single anonymous user) deployment; every create call fails because only the implicit anonymous user exists.","solutions":["Do not create users in noauth mode; all clients share the single anonymous profile.","Switch the deployment to multiuser or another dynamic member provider if multiple accounts are needed.","Adjust client tooling to skip user-creation calls when the provider is noauth."],"exampleFix":"// before\nid, err := memberClient.Insert(username, password, profile)\n\n// after\nif memberProvider == \"noauth\" {\n    return errors.New(\"noauth mode has a single anonymous user; no creation needed\")\n}\nid, err := memberClient.Insert(username, password, profile)","handlingStrategy":"validation","validationCode":"if memberProvider == \"noauth\" {\n    return errors.New(\"noauth mode has a single anonymous user; user creation not needed\")\n}\nid, err := memberClient.Insert(username, password, profile)","typeGuard":"func isNoauthUnsupportedErr(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"in noauth mode\")\n}","tryCatchPattern":"id, err := memberClient.Insert(username, password, profile)\nif err != nil {\n    if isNoauthUnsupportedErr(err) {\n        log.Printf(\"noauth deployment: skip user creation: %v\", err)\n    }\n    return err\n}","preventionTips":["Skip all member CRUD calls when the provider is noauth.","Treat noauth deployments as single-user/anonymous by design.","Switch to multiuser or a dynamic provider when multiple accounts are needed.","Conditionally render user-management UI based on the reported provider."],"tags":["noauth","members","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"}