protected function handleGET()
    {
        $user = Session::user();

        if (empty($user)) {
            throw new UnauthorizedException('There is no valid session for the current request.');
        }

        $data = [
            'username'          => $user->username,
            'first_name'        => $user->first_name,
            'last_name'         => $user->last_name,
            'name'              => $user->name,
            'email'             => $user->email,
            'phone'             => $user->phone,
            'security_question' => $user->security_question,
            'default_app_id'    => $user->default_app_id,
            'oauth_provider'    => (!empty($user->oauth_provider)) ? $user->oauth_provider : '',
            'adldap'            => (!empty($user->adldap)) ? $user->adldap : ''
        ];

        return $data;
    }
protected function handleGET()
    {
        $user = Session::user();

        if (empty($user)) {
            throw new UnauthorizedException('There is no valid session for the current request.');
        }

        $data = [
            'username'          => $user->username,
            'first_name'        => $user->first_name,
            'last_name'         => $user->last_name,
            'name'              => $user->name,
            'email'             => $user->email,
            'phone'             => $user->phone,
            'security_question' => $user->security_question,
            'default_app_id'    => $user->default_app_id,
            'oauth_provider'    => (!empty($user->oauth_provider)) ? $user->oauth_provider : '',
            'adldap'            => (!empty($user->adldap)) ? $user->adldap : ''
        ];

        return $data;
    }
protected function handleGET ( ) { $ user = Session :: user ( ) ; if ( empty ( $ user ) ) { throw new UnauthorizedException ( 'There is no valid session for the current request.' ) ; } $ data = [ 'username' => $ user -> username , 'first_name' => $ user -> first_name , 'last_name' => $ user -> last_name , 'name' => $ user -> name , 'email' => $ user -> email , 'phone' => $ user -> phone , 'security_question' => $ user -> security_question , 'default_app_id' => $ user -> default_app_id , 'oauth_provider' => ( ! empty ( $ user -> oauth_provider ) ) ? $ user -> oauth_provider : '' , 'adldap' => ( ! empty ( $ user -> adldap ) ) ? $ user -> adldap : '' ] ; return $ data ; }
Fetches user profile.

@return array
@throws UnauthorizedException
Fetches user profile .