# Elixir Plugs - question about Plug Modules

**URL:** <https://forum.elixirforum.com/t/elixir-plugs-question-about-plug-modules/3199>\
**Category:** Discussions\
**Tags:** book-programming-elixir, plug, phoenix\
**Created:** [January 9, 2017, 7:52am UTC](https://forum.elixirforum.com/t/elixir-plugs-question-about-plug-modules/3199 "2017-01-09T07:52:00Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![bobbypriambodo](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bobbypriambodo/32/2843_2.png) [@bobbypriambodo](https://forum.elixirforum.com/u/bobbypriambodo)\
**Post date:** [January 9, 2017, 3:38pm UTC](https://forum.elixirforum.com/t/elixir-plugs-question-about-plug-modules/3199/5 "2017-01-09T15:38:54Z")

</div>

And to answer this:

> [@ruevaughn](#):
>
> In the book, we make a module called Rumbl.Auth. This module uses the expected init/1 and call/2 functions, but also adds others, such as login/2, login\_by\_username\_and\_pass/4 and some others.
> 
> Are these ‘other’ functions (login, and login\_by\_username\_and\_pass) relying on call/2 in order to operate properly? Or are they completely isolated and ran independently?

Those other functions are pure functions. They don’t depend on `call/2` whatsoever and, as you said, are isolated from one another.

It might be nice to remember that even though `Rumbl.Auth` is a [module plug](http://www.phoenixframework.org/docs/understanding-plug#section-module-plugs), it is also a module. In Elixir (and many other FP languages), a module is usually just a collection of functions.

The `login/2`, `login_by_username_and_pass/4`, etc. are plain functions. Although `login/2` fulfils the contract of a [function plug](http://www.phoenixframework.org/docs/understanding-plug#section-function-plugs), it is not used as such. They are called with `Rumbl.Auth.login(user)`, and so on.

The reason that those functions are in the `Rumbl.Auth` module is most likely because as the name implies, they deal with user authentication, therefore it makes sense to group them under an `Auth` module.

---

_[View the full topic](https://forum.elixirforum.com/t/elixir-plugs-question-about-plug-modules/3199)._
