Open
Description
It is generally a good idea to move logic out of serializers and into view classes. This makes the code more modular and easier to change. It also makes it easier to override serializers to change the structure of the API.
For example, if the logic for generating tokens was moved to the view class, then you could easily override the serializers to change the name of the "refresh" field to "refresh_token" in both requests body and responses. ( for example for being compatible with some other authentication systems ).