Implemented midding response_type=code functionality
Token endpoint refactoring