Support the ongoing development of Laravel.io →
Authentication Security Packages
Last updated 2 years ago.
0

From what I understand is that everyone each has a unique password.

"We are looking at assigning usernames to everyone"

Does this mean that the user will first sign in just with their unique password?

Then once they sign in they will have a screen to reset their password.

Then they will also create a username after the password is reset.

Then they will have an account.

I need to know the logic before answering your question.

Last updated 2 years ago.
0

Yes. The only part that may be removed will be the create a username. We will just create usernames similar to our existing internal setup. The password reset is one of the critical components. I'm just not sure how to make a page to only show up once for a user - like a password reset form.

Last updated 2 years ago.
0

Just put a boolean or datetime field in the users table and set it when they change their password

Last updated 2 years ago.
0
Solution

There are five components

1)Route

You will need a route for GET and POST for creating an account

These routes should point to your account controller or whatever you name it.

2)Model

You will need to protect your users table and set fillable fields, etc.

3)View

In your form you need to pass the route action and validation conditionals

4)Controller

You will need two methods for creating a users account. They will be getCreate and postCreate

getCreate will return a view

postCreate will have validation and set all input data to users account

  1. Database

    You will need a database and a users table

    The user should have an auto incremented id, password, active, remember_token at least

You will need a conditional in your users account controller that says if user is equal to 0 or 1.

You will need to add a column name active to your users table.

0 would mean they have not created their password yet

1 would mean they have created their password

$user = User::create(array(
				'email'		=>	$email,
				'username'	=>	$username,
				//generate 60 varchar password
				'password'	=>	Hash::make($password),
				'code'		=>	$code,
				'active'	=>	0
			));

if($user) {
   return Redirect::route('page to password reset')
}else{
   return Redirect::route('page saying they already are registered')
}

You would do something like the above.

Last updated 2 years ago.
0

This is great! Thanks for the help swgj19. I will set this up and report back. Always exciting learning new things!

Last updated 2 years ago.
0

Sounds good.

Last updated 2 years ago.
0

This worked great! Thanks for your help.

Last updated 2 years ago.
0

no prob

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Failcookie failcookie Joined 20 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.