Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
f547c126
Commit
f547c126
authored
Sep 27, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ngdocs to the session module
parent
dff7efd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
session.coffee
h/static/scripts/auth/session.coffee
+31
-20
No files found.
h/static/scripts/auth/session.coffee
View file @
f547c126
...
@@ -34,33 +34,44 @@ for action in ACTION
...
@@ -34,33 +34,44 @@ for action in ACTION
csrfToken
=
null
csrfToken
=
null
# Class providing a server-side session resource.
###*
#
# @ngdoc provider
# @name sessionProvider
# @property {Object} options additional options mix into resource actions.
# @description
# This class provides an angular $resource factory as an angular service
# This class provides an angular $resource factory as an angular service
# for manipulating server-side sessions. It defines the authentication-oriented
# for manipulating server-side sessions. It defines the REST-ish actions
# actions (such as 'login', 'register') as REST-ish actions on the session
# that return the state of the users session after modifying it through
# resource.
# registration, authentication, or account management.
#
###
# @example Using the session with BrowserID
# navigator.id.beginAuthentication(function (email) {
# session.load({email: email}, function (session) {
# var user = session.user;
# if(user && user.email == email) {
# navigator.id.completeAuthentication();
# } else {
# displayLoginForm();
# }
# });
# });
#
# Use the 'options' property of its provider to provide additional options
# to be mixed into the resource action definitions.
class SessionProvider
class SessionProvider
options: null
options: null
constructor: ->
constructor: ->
@options = {}
@options = {}
###
*
# @ngdoc service
# @name session
# @description
# An angular resource factory for sessions. See the documentation for
# {@link sessionProvider sessionProvider} for ways to configure the
# resource.
#
# @example
# Using the session with BrowserID.
#
# navigator.id.beginAuthentication(function (email) {
# session.load({email: email}, function (session) {
# var user = session.user;
# if(user && user.email == email) {
# navigator.id.completeAuthentication();
# } else {
# displayLoginForm();
# }
# });
# });
###
$get
:
[
$get
:
[
'$q'
,
'$resource'
,
'documentHelpers'
,
'flash'
,
'$q'
,
'$resource'
,
'documentHelpers'
,
'flash'
,
(
$q
,
$resource
,
documentHelpers
,
flash
)
->
(
$q
,
$resource
,
documentHelpers
,
flash
)
->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment