当前位置: 首页>>代码示例>>PHP>>正文


PHP OAuth::authorize方法代码示例

本文整理汇总了PHP中OAuth::authorize方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuth::authorize方法的具体用法?PHP OAuth::authorize怎么用?PHP OAuth::authorize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OAuth的用法示例。


在下文中一共展示了OAuth::authorize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

use SocialNorm\Exceptions\ApplicationRejectedException;
use SocialNorm\Exceptions\InvalidAuthorizationCodeException;
use App\User;
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
Route::get('/', 'ItemController@index');
Route::get('woj/{woj}', 'ItemController@showPowiaty');
Route::get('woj/{woj}/pow/{pow}', 'ItemController@showGminy');
Route::get('woj/{woj}/pow/{pow}/gmi/{gmi}', 'ItemController@showGmina');
Route::any('/search', 'SearchController@search');
Route::get('facebook/authorize', function () {
    return OAuth::authorize('facebook');
});
Route::get('google/authorize', function () {
    return OAuth::authorize('google');
});
Route::get('facebook/login', 'SocialController@facebookLogin');
Route::get('google/redirect', 'SocialController@googleRedirect');
Route::any('autocomplete/', 'SearchController@autocomplete');
Route::get('podmiot/{slug}', 'ItemController@showItem');
// Route that handles submission of review - rating/comment
Route::post('podmiot/{slug}', array('before' => 'csrf', 'ReviewController@addReview'));
开发者ID:4tulik,项目名称:Laravel-5-YellowPages,代码行数:31,代码来源:routes.php

示例2: function

]);*/
/*Route::get('patterns',[
    'uses' => 'PatternController@latest',
    'as' => 'patterns'
]);*/
use App\Models\patterns\Category;
use App\Models\patterns\Subcategory;
Route::get('/', ['as' => 'patterns.latest', 'uses' => 'home\\PatternController@latest']);
Route::get('/populares', ['as' => 'patterns.popular', 'uses' => 'home\\PatternController@popular']);
Route::get('/pendientes', ['as' => 'patterns.open', 'uses' => 'home\\PatternController@open']);
Route::get('/pending', ['as' => 'patterns.pending', 'uses' => 'home\\PatternController@pending']);
Route::get('/tutoriales', ['as' => 'patterns.closed', 'uses' => 'home\\PatternController@closed']);
Route::get('/solicitud/{id}', ['as' => 'patterns.details', 'uses' => 'home\\PatternController@details']);
// Authentication Social routes ...
Route::get('{provider}/authorize', function ($provider) {
    return OAuth::authorize($provider);
});
Route::get('{provider}/login', function ($provider) {
    OAuth::login($provider, function ($user, $userDetails) {
        $user->username = $userDetails->nickname;
        $user->email = $userDetails->email;
        $user->save();
    });
    return view('admin/dashboard');
});
// Authentication routes ...
Route::get('login', ['uses' => 'Auth\\AuthController@getLogin', 'as' => 'login']);
Route::post('login', 'Auth\\AuthController@postLogin');
Route::get('logout', ['uses' => 'Auth\\AuthController@getLogout', 'as' => 'logout']);
// Registration routes ...
Route::get('register', ['uses' => 'Auth\\AuthController@getRegister', 'as' => 'register']);
开发者ID:alfons83,项目名称:tfg,代码行数:31,代码来源:routes.php

示例3: linkedInAuthorize

 public function linkedInAuthorize()
 {
     return OAuth::authorize('linkedin');
 }
开发者ID:Juslog12,项目名称:diversitycircle,代码行数:4,代码来源:UsersController.php

示例4: function

*/
use App\User;
Route::get('/', function () {
    if (Auth::check()) {
        if (Auth::user()->password == "") {
            return view('home.registro');
        }
        if (Auth::user()->password != "") {
            return view('inicio.inicio');
        }
    } else {
        return view('home.home');
    }
});
Route::get('auth', function () {
    return OAuth::authorize('facebook');
});
Route::get('logout', array('as' => 'logout', function () {
}))->before('auth');
Route::get('login', function () {
    try {
        OAuth::login('facebook', function ($user, $details) {
            $exist = User::where('email', $details->email)->first();
            if ($exist) {
                $user = $exist;
            }
            $user->name = $details->full_name;
            $user->email = $details->email;
            $user->provider_user_id = $details->id;
            return $user;
        });
开发者ID:reidid,项目名称:sorehcnac,代码行数:31,代码来源:routes.php


注:本文中的OAuth::authorize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。