You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-22Lines changed: 26 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,22 @@
1
-
# Laravel PIN Login
1
+
# Laravel TOTP Login
2
2
3
-
[](https://packagist.org/packages/empuxa/laravel-pin-login)
[](https://packagist.org/packages/empuxa/laravel-totp-login)
Say goodbye to passwords and sign in via PIN instead!
10
-
Laravel PIN Login is a convenient package that allows you to easily add a PIN login feature to your Laravel application.
9
+
Say goodbye to passwords and sign in via a time-based one-time password instead!
10
+
Laravel TOTP Login is a convenient package that allows you to easily add a TOTP login feature to your Laravel application.
11
11
12
-
## Why Choose Laravel PIN Login?
13
-
You might wonder why you should opt for a PIN login instead of a magic link solution. Well, this package is designed to complement the existing login methods in your application. It provides an alternative sign-in option for users who haven't set a password yet or don't have an email address. For instance, users who signed up with only a phone number can still enjoy the benefits of secure login through a PIN.
12
+
## Why Choose Laravel TOTP Login?
13
+
You might wonder why you should opt for a TOTP login instead of a magic link solution.
14
+
Well, this package is designed to complement the existing login methods in your application.
15
+
It provides an alternative sign-in option for users who haven't set a password yet or don't have an email address.
16
+
For instance, users who signed up with only a phone number can still enjoy the benefits of secure login through a TOTP.
14
17
15
18
## Features
16
-
- Simplified sign-in process using a PIN
19
+
- Simplified sign-in process using a TOTP
17
20
- Compatibility with existing login methods
18
21
- Support for users without passwords or email addresses
19
22
@@ -31,13 +34,13 @@ Also, you need to have a notifiable user model.
31
34
Install the package via composer:
32
35
33
36
```bash
34
-
composer require empuxa/laravel-pin-login
37
+
composer require empuxa/laravel-totp-login
35
38
```
36
39
37
-
Copy the vendor files and adjust the config file `config/pin-login.php` to your needs:
40
+
Copy the vendor files and adjust the config file `config/totp-login.php` to your needs:
You're ready to start using the PIN login feature in your Laravel application.
53
+
You're ready to start using the TOTP login feature in your Laravel application.
51
54
52
55
## Usage
53
56
54
57
The sign-in process for this repository involves three steps:
55
-
1. Enter the user's email address, phone number, or any other specified identifier, and request a PIN.
56
-
2. If the entered information is valid, a PIN will be sent to the user. You may need to customize the notification channel based on the user model you are using.
57
-
3. Enter the received PIN to log in the user.
58
+
1. Enter the user's email address, phone number, or any other specified identifier, and request a TOTP.
59
+
2. If the entered information is valid, a TOTP will be sent to the user. You may need to customize the notification channel based on the user model you are using.
60
+
3. Enter the received TOTP to log in the user.
58
61
59
62
### Customizing the Views
60
63
61
64
While the initial steps are relatively straightforward, it's now necessary to customize the views.
62
-
These views have been designed to be as simple as possible (some might even consider them "ugly") and can be located in the `resources/views/vendor/pin-login` directory.
65
+
These views have been designed to be as simple as possible (some might even consider them "ugly") and can be located in the `resources/views/vendor/totp-login` directory.
63
66
64
67
*Why are they not visually appealing?*
65
68
Different applications adopt various layouts and frameworks.
66
69
Since you have the most knowledge about your application, you can change the views to suit your specific requirements.
67
70
68
71
### Modifying the Notification
69
-
Within the copied views, you will come across a notification that's sent to the user.
72
+
Within the copied views, you will come across a notification sent to the user.
70
73
You may want to make adjustments to this notification to align it with your preferences and needs.
71
74
72
75
#### Different Notification Channels
73
-
If you plan on utilizing SMS or similar as your preferred notification channel, you have the option to create a custom notification class.
74
-
The PIN and the user's IP address will be passed to the constructor of this class. Finally, replace the default notification class within the `config/pin-login.php` file with your custom notification.
76
+
If you plan on using SMS or similar as your preferred notification channel, you can create a custom notification class.
77
+
The TOTP and the user's IP address will be passed to the constructor of this class.
78
+
Finally, replace the default notification class within the `config/totp-login.php` file with your custom notification.
75
79
76
80
### Custom User Model Scope
77
81
To apply a scope to your user model, add the following method to your model:
0 commit comments