{"id":15060335,"url":"https://github.com/mu-semtech/ember-mu-login","last_synced_at":"2025-04-10T05:50:51.779Z","repository":{"id":46037359,"uuid":"50541874","full_name":"mu-semtech/ember-mu-login","owner":"mu-semtech","description":"Default Ember component for login-service","archived":false,"fork":false,"pushed_at":"2025-04-03T17:51:02.000Z","size":254,"stargazers_count":1,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T18:37:29.495Z","etag":null,"topics":["authentication","ember-addon","emberjs","mu-frontend","musemtech"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mu-semtech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2016-01-27T22:17:15.000Z","updated_at":"2025-04-03T17:51:06.000Z","dependencies_parsed_at":"2024-11-14T07:00:15.577Z","dependency_job_id":null,"html_url":"https://github.com/mu-semtech/ember-mu-login","commit_stats":{"total_commits":76,"total_committers":9,"mean_commits":8.444444444444445,"dds":0.5789473684210527,"last_synced_commit":"95e1d3b180fcf98917796a29846f4c1318568a93"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fember-mu-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fember-mu-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fember-mu-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mu-semtech%2Fember-mu-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mu-semtech","download_url":"https://codeload.github.com/mu-semtech/ember-mu-login/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166926,"owners_count":21058480,"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":["authentication","ember-addon","emberjs","mu-frontend","musemtech"],"created_at":"2024-09-24T22:57:07.059Z","updated_at":"2025-04-10T05:50:51.759Z","avatar_url":"https://github.com/mu-semtech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-mu-login\n\nThis addon provides a mu-login and mu-logout component for the [mu-login microservice](https://github.com/mu-semtech/login-service). The addon uses [ember-simple-auth](https://github.com/simplabs/ember-simple-auth) for authentication.\n\n## How-To\n### Basic usage\nInstall the Ember addons\n\n```bash\nember install ember-simple-auth\nember install ember-mu-login\n```\n\nMake sure to use ember-simple-auth \u003e= v6.0.0\n\nAs part of installing `ember-simple-auth` it's necessary to set-up the session service, so somewhere\nnear the root of your app, inject the service and call `setup()` on it. For example:\n\n``` js\n// app/routes/application.js\nimport Route from '@ember/routing/route'\nimport { service } from '@ember/service'\n\nexport default class ApplicationRoute extends Route {\n  @service session;\n\n  async beforeModel(...args) {\n    await this.session.setup();\n  }\n}\n```\n\nAfter installation, include the `\u003cMuLogin /\u003e` and `\u003cMuLogout /\u003e` component somewhere in your template(s).\n\nHave a look at the [ember-simple-auth addon](https://github.com/mainmatter/ember-simple-auth#walkthrough) to understand how to protect your routes. The session authentication/invalidation is already handled by this addon.\n\n### Customize the components layout\nIf you want to customize the layout of the `MuLogin` and/or `MuLogout` component, you will need to extend those components. This tutorial explains customization of the `MuLogin` component, but the process for `MuLogout` is similar.\n\nGenerate a `MuLogin` component for your application\n\n```bash\nember g component -gc mu-login\n```\n\nOverwrite the generated `app/components/mu-login.js` file with the following contents\n```javascript\nimport MuLoginComponent from 'ember-mu-login/components/mu-login';\n\nexport default class MyMuLoginComponent extends MuLoginComponent {\n\n}\n```\n\nYou can now customize the generated `app/components/mu-login.hbs` file as needed. The login action can be triggered using `{{on \"click\" this.login}}`. Have a look at the `MuLogin`-component documentation for all options.\n\n## Reference\n### Components\n#### MuLogin\nComponent rendering a login form with a username and password field.\n\n##### Arguments\nThe following arguments can be passed to the component\n\n| Name             | Req | Description                                                |\n|------------------|-----|------------------------------------------------------------|\n| label            |     | Label for the login button (default: \"Login\")              |\n| placeholder      |     | Placeholder value for the username input field             |\n| forbiddenMessage |     | Error message to show if a user doesn't have access        |\n| failureMessage   |     | Error message to show if something went wrong during login |\n\n##### Properties\nThe following properties can be used in the component's template using `{{this.propName}}`\n\n| Name             | Description                                                                      |\n|------------------|----------------------------------------------------------------------------------|\n| nickname         | Value of the username input field                                                |\n| password         | Value of the password input field                                                |\n| isAuthenticating | Whether the authentication request is currently running                          |\n| label            | Label for the login button with default fallback                                 |\n| placeholder      | Placeholder value for username input field with default fallback                 |\n| forbiddenMessage | Error message to show if a user doesn't have access with default fallback        |\n| failureMessage   | Error message to show if something went wrong during login with default fallback |\n| errorMessage     | Error message received from the backend on failure                               |\n\n##### Actions\nThe following actions are available\n\n| Name  | Description                                             |\n|-------|---------------------------------------------------------|\n| login | Login attempt using the filled in username and password |\n\n#### MuLogout\nComponent rendering a button to logout.\n\n##### Arguments\nThe following arguments can be passed to the component\n\n| Name             | Req | Description                                                |\n|------------------|-----|------------------------------------------------------------|\n| label            |     | Label for the logout button (default: \"Logout\")              |\n\n##### Properties\nThe following properties can be used in the component's template using `{{this.propName}}`\n\n| Name             | Description                                                                      |\n|------------------|----------------------------------------------------------------------------------|\n| label            | Label for the logout button with default fallback                                 |\n\n##### Actions\nThe following actions are available\n\n| Name    | Description                              |\n|---------|------------------------------------------|\n| lougout | Action to invalidate the current session |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmu-semtech%2Fember-mu-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmu-semtech%2Fember-mu-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmu-semtech%2Fember-mu-login/lists"}