Skip to content

Commit ea1008d

Browse files
committed
docs: update session and event name to magicLogin
1 parent bb9c1fd commit ea1008d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/quickstart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,26 +135,26 @@ Magic Link logins allow a user that has forgotten their password to have an emai
135135

136136
#### Session Notification
137137

138-
You can detect if a user has finished the magic link login by checking for a session value, `magic_link_login`. If they have recently completed the flow, it will exist and have a value of `true`.
138+
You can detect if a user has finished the magic link login by checking for a session value, `magicLogin`. If they have recently completed the flow, it will exist and have a value of `true`.
139139

140140
```php
141-
if (session('magic_login')) {
141+
if (session('magicLogin')) {
142142
return redirect()->route('set_password');
143143
}
144144
```
145145

146146
This value sticks around in the session for 5 minutes. Once you no longer need to take any actions, you might want to delete the value from the session.
147147

148148
```php
149-
session()->removeTempData('magic_link_login');
149+
session()->removeTempData('magicLogin');
150150
```
151151

152152
#### Event
153153

154-
At the same time the above session variable is set, a `magic_login` [event](https://codeigniter.com/user_guide/extending/events.html) is fired off that you may subscribe to. Note that no data is passed to the event as you can easily grab the current user from the `user()` helper or the `auth()->user()` method.
154+
At the same time the above session variable is set, a `magicLogin` [event](https://codeigniter.com/user_guide/extending/events.html) is fired off that you may subscribe to. Note that no data is passed to the event as you can easily grab the current user from the `user()` helper or the `auth()->user()` method.
155155

156156
```php
157-
Events::on('magic_login', static function () {
157+
Events::on('magicLogin', static function () {
158158
// ...
159159
});
160160
```

0 commit comments

Comments
 (0)