Skip to content

Commit 56fd477

Browse files
committed
# Bumped to version 0.8.0
1 parent a15e0f1 commit 56fd477

File tree

5 files changed

+43
-3684
lines changed

5 files changed

+43
-3684
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.8.0
2+
- Rightfully changed the API verifyEmail to confirmEnail (by @SteffenDE)
3+
14
## 0.7.2
25
- Fixed typescript declaration file with the update of eventemitter2 (by @polco)
36
- Added support of custom field for authentication (by @ThonyFD)

README.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ Broadcast when a provider has been linked to the account.
9292
Returns true if the user is currently authenticated; otherwise false. (synchronous)
9393

9494
##### `superlogin.authenticate()`
95-
Returns a promise that is resolved as soon as the user has authenticated. If the user never authenticates, this promise will stay waiting forever.
95+
Returns a promise that is resolved as soon as the user has authenticated.
96+
If the user never authenticates, this promise will stay waiting forever.
9697

9798
##### `superlogin.getConfig()`
9899
Returns the config object. (synchronous)
@@ -125,31 +126,44 @@ Makes an HTTP call to refresh the access token.
125126
Checks if the session has exceeded the refresh threshold, and calls refresh if necessary
126127

127128
##### `superlogin.checkExpired()`
128-
Checks if the session has expired and logs out if the access token is no longer valid. Accounts for server time difference.
129+
Checks if the session has expired and logs out if the access token is no longer valid.
130+
Accounts for server time difference.
129131

130132
##### `superlogin.login(credentials)`
131-
Passes credentials to the server to log the user in. Returns a promise that resolves with session information upon successful login, or rejects with an error message if login fails. The credentials object must contain `username` and `password`.
133+
Passes credentials to the server to log the user in.
134+
Returns a promise that resolves with session information upon successful login, or rejects with an error message if login fails.
135+
The credentials object must contain `username` and `password`.
132136

133137
##### `superlogin.register(registration)`
134-
Passes the registration form to SuperLogin to create a new user. Returns a promise. If the sever returns session information the user is automatically logged in.
138+
Passes the registration form to SuperLogin to create a new user. Returns a promise.
139+
If the sever returns session information the user is automatically logged in.
135140

136141
##### `superlogin.logout(message)`
137-
Logs out the current session and returns a promise. Deletes the session and resolves the promise no matter what. The optional `message` will be broadcast with the 'sl:logout' event.
142+
Logs out the current session and returns a promise.
143+
Deletes the session and resolves the promise no matter what.
144+
The optional `message` will be broadcast with the 'sl:logout' event.
138145

139146
##### `superlogin.logoutAll(message)`
140-
Logs out ALL the user's open sessions and returns a promise. Deletes the session and resolves the promise no matter what. The optional `message` will be broadcast with the 'sl:logout' event.
147+
Logs out ALL the user's open sessions and returns a promise.
148+
Deletes the session and resolves the promise no matter what.
149+
The optional `message` will be broadcast with the 'sl:logout' event.
141150

142151
##### `superlogin.logoutOthers()`
143152
Logs out all the user's open sessions EXCEPT the current one. Returns a promise.
144153

145154
##### `superlogin.socialAuth(provider)`
146-
Opens a popup window to authenticate the specified provider. Returns a promise that is rejected if authentication fails, or the popup is closed prematurely. Also rejects if the provider is not present in the `providers` list in the config.
155+
Opens a popup window to authenticate the specified provider.
156+
Returns a promise that is rejected if authentication fails, or the popup is closed prematurely.
157+
Also rejects if the provider is not present in the `providers` list in the config.
147158

148159
##### `superlogin.tokenSocialAuth(provider, accessToken)`
149-
Login using an access_token obtained by the client for the specified provider. This is useful for PhoneGap and native plugins. Rejects if the provider is not present in the `providers` list in the config.
160+
Login using an access_token obtained by the client for the specified provider.
161+
This is useful for PhoneGap and native plugins.
162+
Rejects if the provider is not present in the `providers` list in the config.
150163

151164
##### `superlogin.link(provider)`
152-
Opens a popup window to link provider to the already authenticated user. Returns a promise that will reject if the user is not authenticated, the popup is closed prematurely, or the link fails.
165+
Opens a popup window to link provider to the already authenticated user.
166+
Returns a promise that will reject if the user is not authenticated, the popup is closed prematurely, or the link fails.
153167

154168
##### `superlogin.tokenLink(provider, accessToken)`
155169
Link a provider using an access_token obtained by the client. Returns a promise.
@@ -158,22 +172,31 @@ Link a provider using an access_token obtained by the client. Returns a promise.
158172
Unlinks the specified provider from the user's account. Returns a promise.
159173

160174
##### `superlogin.confirmEmail(token)`
161-
Verifies the user's email with the SuperLogin server, using the specified token. Returns a promise. Authentication is not required. The token will be a URL parameter passed in when the user clicks on the confirmation link in the email sent by the system. Your app needs to manually extract the token from the URL and pass it in here.
175+
Verifies the user's email with the SuperLogin server, using the specified token.
176+
Returns a promise. Authentication is not required.
177+
The token will be a URL parameter passed in when the user clicks on the confirmation link in the email sent by the system.
178+
Your app needs to manually extract the token from the URL and pass it in here.
162179

163180
##### `superlogin.forgotPassword(email)`
164181
Makes an HTTP request to SuperLogin to send a forgot password email to the user. Authentication is not required.
165182

166183
##### `superlogin.resetPassword(form)`
167-
Forwards the supplied reset password form to SuperLogin. Must include `token`, `password`, and `confirmPassword`. The token needs to beis extracted from the URL when the user clicks on the link in the password reset email.
184+
Forwards the supplied reset password form to SuperLogin. Must include `token`, `password`, and `confirmPassword`.
185+
The token needs to beis extracted from the URL when the user clicks on the link in the password reset email.
168186

169187
##### `superlogin.changePassword(form)`
170-
Changes the authenticated user's password, or creates one if it has not been set. If a password already exists, then `currentPassword` is required. If no password is set, then only `newPassword` and `confirmPassword` are required.
188+
Changes the authenticated user's password, or creates one if it has not been set.
189+
If a password already exists, then `currentPassword` is required.
190+
If no password is set, then only `newPassword` and `confirmPassword` are required.
171191

172192
##### `superlogin.changeEmail(newEmail)`
173-
Changes the authenticated user's email. If email confirmation is enabled, a new confirm email will go out, and the email will not be changed until the new address is confirmed.
193+
Changes the authenticated user's email.
194+
If email confirmation is enabled, a new confirm email will go out, and the email will not be changed until the new address is confirmed.
174195

175196
##### `superlogin.logoutAll(message)`
176-
Logs out ALL the user's open sessions and returns a promise. Deletes the session and resolves the promise no matter what. The optional `message` will be broadcast with the 'sl:logout' event.
197+
Logs out ALL the user's open sessions and returns a promise.
198+
Deletes the session and resolves the promise no matter what.
199+
The optional `message` will be broadcast with the 'sl:logout' event.
177200

178201
##### `superlogin.validateUsername(username)`
179202
Returns a promise that will resolve if the username is valid and not currently in use, or reject otherwise.

config.example.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const config = {
44
serverUrl: 'http://localhost:3000',
55
// The base URL for the SuperLogin routes with leading and trailing slashes (defaults to '/auth/')
66
baseUrl: '/auth/',
7+
// An optional URL for social auth/link, by default equals to `baseUrl`
8+
socialUrl: 'http://localhost:3001/social',
79
// A list of API endpoints to automatically add the Authorization header to
810
// By default the host the browser is pointed to will be added automatically
911
endpoints: ['api.example.com'],

0 commit comments

Comments
 (0)