{"id":16520241,"url":"https://github.com/khadkarajesh/auth","last_synced_at":"2025-06-14T21:39:05.278Z","repository":{"id":93163990,"uuid":"157851913","full_name":"khadkarajesh/Auth","owner":"khadkarajesh","description":"Authentication module","archived":false,"fork":false,"pushed_at":"2018-11-20T12:03:17.000Z","size":198,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T23:41:52.924Z","etag":null,"topics":["android-architecture-components","android-ktx","android-library","authentication","kotlin-android","kotlin-coroutines","retrofit2","reusable-components"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khadkarajesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-16T10:29:40.000Z","updated_at":"2018-11-19T12:16:26.000Z","dependencies_parsed_at":"2023-04-03T11:47:22.080Z","dependency_job_id":null,"html_url":"https://github.com/khadkarajesh/Auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/khadkarajesh/Auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2FAuth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2FAuth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2FAuth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2FAuth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khadkarajesh","download_url":"https://codeload.github.com/khadkarajesh/Auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khadkarajesh%2FAuth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259888187,"owners_count":22927072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-architecture-components","android-ktx","android-library","authentication","kotlin-android","kotlin-coroutines","retrofit2","reusable-components"],"created_at":"2024-10-11T16:50:09.999Z","updated_at":"2025-06-14T21:39:05.254Z","avatar_url":"https://github.com/khadkarajesh.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auth\nAuthentication module\n\n# Uses\nAdd in Application class\n\n## Step 1\nAdd config on applcations ```onCreate()```\n``` \nvar endPoint = EndPoint.Builder()\n                .baseUrl(\"your_base_url\")\n                .login(\"auth/authenticate\")\n                .forgotPassword(\"password/reset\")\n                .resetPassword(\"password/reset\")\n                .build()\nAuthConfig.setEndpoint(endPoint)\n```\n## Step 2\nRegister event to get response\n```\nEventBus.register(this)\n```\nGet Response as:\n```\n @Subscribe\n    fun onSuccess(event: AuthEvent) {\n        when (event) {\n            is LoginSuccess -\u003e {\n               // your result\n            }\n        }\n    }\n```\n\n# Deserialize Response Body BaseResponse\u003cT\u003e \n```\nclass BaseResponse\u003cR\u003e {\n    @SerializedName(\"body\")\n    val body: R? = null\n}\n```\n\n```\nvar gson = Gson()\nvar baseResponse: BaseResponse\u003cUser\u003e = Gson().fromJson(event.result.string(), gson.getType(BaseResponse::class.java, User::class.java))\nLog.d(\"login success\", \"called \" + baseResponse.body?.firstName)\nthis.startActivity(Intent(this, DashboardActivity::class.java))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhadkarajesh%2Fauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhadkarajesh%2Fauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhadkarajesh%2Fauth/lists"}