Category : authentication

500 (Internal Server Error) when I try to submit user data to laravel. Actually it stores data fine if I execute in laravel: User::create($request->all()) So it means the connection between client and server is alright. Angular @Component({ selector: ‘app-register’, templateUrl: ‘./register.component.html’, styleUrls: [‘./register.component.css’] }) export class RegisterComponent implements OnInit { form: FormGroup; constructor(private fb: FormBuilder, ..

Read more

i’am facing a probleme while trying to connect to my mongoDB with robo t3 My docker container connfiguration : todo_mongodb: container_name: mongodb image: mongo:latest ports: – "27017:27017" environment: – MONGO_INITDB_ROOT_USERNAME=admin – MONGO_INITDB_ROOT_PASSWORD=admin – MONGO_INITDB_DATABASE=admin volumes: – "./mongo/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d" Docker ps command show’s : i’am able to access mongodb shell and login as admin using winpty docker ..

Read more

Laravel web auth was working well. I’m trying to use jwt-auth module. Here’s my code with jwt-auth module —authcontroller.php public function login(Request $request) { $validator = Validator::make($request->all(), [ ’email’ => ‘required|email’, ‘password’ => ‘required|string|min:6’, ]); if ($validator->fails()) { // return response()->json($validator->errors(), 200); session()->flash(‘error’, json_encode($validator->errors())); return back()->withInput(); } if (!$token = auth()->attempt($validator->validated())) { // return response()->json([‘error’ ..

Read more

I have uploaded my project to CPanel, and everything was working smoothly. However, I noticed that after login the exceptions where I used if (Auth::check() && Auth::user()->id) {…} else{…} if (Auth::check() && Auth::user()->role_id === 1) {…} else{…} if (Auth::check() && Auth::user()->role_id === 1) {…} else{…} does not appear but everything works fine without any errors. ..

Read more

After installing laravel 7 version, I immediately installed ui: auth, ran the php artisan ui bootstrap –auth command (for installation with bootstrap markup), initially everything worked, I had no trouble, but now when going to the pages (Login, registration, reset password) I have a 404 error. web.php (route file) <?php use IlluminateSupportFacadesRoute; /* |————————————————————————– | ..

Read more

this is my code store function : page service public store( data : any ) { return this.httpService.makePost(‘auth/personalInfo’, data, true).pipe(map( res => { localStorage.setItem( ‘token’, res.headers.get(‘Authorization’) ); return res.json().personal_info; }, error => { console.log("error stornig") localStorage.setItem( ‘token’, error.headers.get(‘Authorization’) ); return error.json(); } )); } addinfo function page.ts addInfo() { console.log("Hey mony"); let data = { ..

Read more

So this is my login code function checklogin(Request $request){ $this->validate($request,[ ‘nip’ => ‘required’, ‘password’ => ‘required’ ]); $akun_data = array( ‘nip’ => $request->get(‘nip’), ‘password’ => $request->get(‘password’) ); if(Auth::attempt($akun_data)){ return redirect(‘login/successlogin’); }else{ return back()->with(‘message’,’NIP or Password is wrong’); } } and this is my logout code : function logout(){ $akun = Auth::user(); $akun_data = Akun::find($akun->nip); $akun_data->status ..

Read more

This is my code in LoginController: public function handleProviderCallback($provider) { $socialUser = Socialite::driver($provider)->stateless()->user(); $user = User::where(’email’, $socialUser->getEmail())->first(); if (!$user) { $user = User::create([ ‘name’ => $socialUser->getName(), ’email’ => $socialUser->getEmail(), ‘password’ => Hash::make(‘12345678’), ‘social_id’ => $socialUser->getId(), ]); } Auth::login($user, true); return redirect()->intended($this->redirectPath()); } When performing normal login, it redirects to intended. But, in case of social ..

Read more

I’m trying to create user authentication for Active Directory. I am using Laravel and standard authentication. I slightly altered the standard login form, earlier there were input fields email and password. In form I changed these two fields: <input type="text" name="accountName" required> (Active Directory account) <input type="password" name="activeDirectoryPassword" required> (Active Directory password) In these fields, ..

Read more

Estou tentando limitar o acesso a determinada área da aplicação através de um login, utilizando o Auth do laravel 8, e estou recebendo o seguinte erro: "Route [login] not defined" ao clicar no botão "cursos" da Navbar presente em ‘topo.blade.php’ que deveria me redirecionar a rota de login já definida em ‘web.php’. Vasculhei meu código ..

Read more

i’m building an API for a single page application (spa) that is completely separated (different domain) what is the best approach for authentication ? passport,sanctum? Passport is a good choice but its kinda complicated i can’t understand it and i don’t need the oauth feature .. i just want an access token and maybe a ..

Read more

I have installed laravel jetstream(livewire) and was trying to migrate. but it’s showing the following message : F:laraveltestauth>php artisan migrate Migrating: 2014_10_12_000000_create_users_table IlluminateDatabaseQueryException SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `val` add unique `val_email_unique`(`email`)) and in server http://127.0.0.1:8000 IlluminateDatabaseQueryException SQLSTATE[42S02]: Base ..

Read more