[feature/api] Added exception throwing to auth repository

Previously the Auth repository would return arrays with errors.
Now they throw an exception instead which can be handled
in a much nicer way.

PHPBB3-11595