mirror of
https://github.com/exane/not-gwent-online
synced 2025-08-03 12:53:28 +00:00
simple register
This commit is contained in:
site
@@ -1,5 +1,23 @@
|
||||
<?php
|
||||
|
||||
// todo: move to controllers
|
||||
use Gwent\User;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
|
||||
Route::group(['prefix' => 'api'], function() {
|
||||
|
||||
post('/register', function() {
|
||||
$user = new User();
|
||||
$user->username = Request::input('username');
|
||||
$user->email = Request::input('email');
|
||||
$user->password = bcrypt(Request::input('password'));
|
||||
$user->save();
|
||||
|
||||
Auth::login($user);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
get('/lobby', function() {
|
||||
return innerView();
|
||||
});
|
||||
|
Reference in New Issue
Block a user