Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Laravel Socialite sample #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

emiliocr90
Copy link

No description provided.

@Tchekda Tchekda self-requested a review November 1, 2022 08:48
@Tchekda
Copy link
Member

Tchekda commented Nov 1, 2022

  1. Please use a lower-case folder like laravel-socialite
  2. Please do not copy paste from internal IVAO code (Helper functions, access lists, etc.. are not needed here).
  3. Please make a fully-functional boilerplate, meaning create a new laravel project inside the folder and add the IVAO auth to it.

@emiliocr90
Copy link
Author

  1. Please use a lower-case folder like laravel-socialite
  2. Please do not copy paste from internal IVAO code (Helper functions, access lists, etc.. are not needed here).
  3. Please make a fully-functional boilerplate, meaning create a new laravel project inside the folder and add the IVAO auth to it.

What do you think now?

Copy link
Member

@Tchekda Tchekda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please do not commit the vendor folder
  • Please update the home page to display if the user is logged or not, if so, display his information (name, vid, etc...)

Comment on lines +1 to +30
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_socialite
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the env file with needed values only and put the IVAO ones there to make the demo work OOTB

Comment on lines +1 to +26
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>

<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>

## About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

Laravel is accessible, powerful, and provides tools required for large, robust applications.

## Learning Laravel

Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the readme keep only the needed information to run the demo and common bugs.
Please refer to the ReactJS example

Comment on lines +25 to +26
$request->session()->put('token', $ivaoUser->token);
$request->session()->put('refreshToken', $ivaoUser->refreshToken);
Copy link
Member

@Tchekda Tchekda Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed if the user object (already storing those values) is also saved in session ?

Auth::logout();
$request->session()->flush();

return redirect('https://www.ivao.aero/')->withCookie(cookie($this->cookie_name, '', -3600));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is cookie_name defined here ?

Comment on lines +1 to +5
{
"require": {
"laravel/socialite": "^5.5"
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the composer.json in the laravel-socialite folder and not the root one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants