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
+37-14Lines changed: 37 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,8 @@ Broadcast when a provider has been linked to the account.
92
92
Returns true if the user is currently authenticated; otherwise false. (synchronous)
93
93
94
94
##### `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.
96
97
97
98
##### `superlogin.getConfig()`
98
99
Returns the config object. (synchronous)
@@ -125,31 +126,44 @@ Makes an HTTP call to refresh the access token.
125
126
Checks if the session has exceeded the refresh threshold, and calls refresh if necessary
126
127
127
128
##### `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.
129
131
130
132
##### `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`.
132
136
133
137
##### `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.
135
140
136
141
##### `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.
138
145
139
146
##### `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.
141
150
142
151
##### `superlogin.logoutOthers()`
143
152
Logs out all the user's open sessions EXCEPT the current one. Returns a promise.
144
153
145
154
##### `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.
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.
150
163
151
164
##### `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.
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.
158
172
Unlinks the specified provider from the user's account. Returns a promise.
159
173
160
174
##### `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.
162
179
163
180
##### `superlogin.forgotPassword(email)`
164
181
Makes an HTTP request to SuperLogin to send a forgot password email to the user. Authentication is not required.
165
182
166
183
##### `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.
168
186
169
187
##### `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.
171
191
172
192
##### `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.
174
195
175
196
##### `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.
177
200
178
201
##### `superlogin.validateUsername(username)`
179
202
Returns a promise that will resolve if the username is valid and not currently in use, or reject otherwise.
0 commit comments