# useLogin

The useLogin can be used to handle user login. It takes from localStorage info about the last visited route of the user and redirects to it. If a route is not present it will redirect to the dashboard page.

# Example usage

<script>
import { useContext, useLogin } from '@jdi/vue-backoffice-library'

export default {
  setup(_, context) {
    const { route, router } = useContext(context)
    const { handleAfterLogin } = useLogin({ route, router })
    return { handleAfterLogin }
  }
}
</script>