rpc: code refactoring
401 -> 403
Redirect to login or register after oauth callback