Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
Paul-Christian Volkmer
ARSnova Backend
Commits
14fd1ec8
Commit
14fd1ec8
authored
12 years ago
by
Julian Hochstetter
Browse files
Options
Downloads
Patches
Plain Diff
Fehler #3925
parent
87fb504f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/SessionController.java
+5
-3
5 additions, 3 deletions
src/main/java/de/thm/arsnova/SessionController.java
with
5 additions
and
3 deletions
src/main/java/de/thm/arsnova/SessionController.java
+
5
−
3
View file @
14fd1ec8
...
...
@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
de.thm.arsnova.entities.Session
;
import
de.thm.arsnova.entities.User
;
import
de.thm.arsnova.services.ISessionService
;
import
de.thm.arsnova.services.IUserService
;
import
de.thm.arsnova.socket.ARSnovaSocketIOServer
;
...
...
@@ -61,9 +62,10 @@ public class SessionController {
if
(
sessionkey
==
null
)
{
return
;
}
logger
.
info
(
"authorize session: "
+
sessionkey
+
", user is: "
+
userService
.
getUser
(
SecurityContextHolder
.
getContext
().
getAuthentication
()));
boolean
result
=
server
.
authorize
(
UUID
.
fromString
(
sessionkey
),
userService
.
getUser
(
SecurityContextHolder
.
getContext
().
getAuthentication
()));
response
.
setStatus
(
result
?
HttpStatus
.
CREATED
.
value
()
:
HttpStatus
.
UNAUTHORIZED
.
value
());
User
u
=
userService
.
getUser
(
SecurityContextHolder
.
getContext
().
getAuthentication
());
logger
.
info
(
"authorize session: "
+
sessionkey
+
", user is: "
+
u
);
response
.
setStatus
(
u
!=
null
?
HttpStatus
.
CREATED
.
value
()
:
HttpStatus
.
UNAUTHORIZED
.
value
());
server
.
authorize
(
UUID
.
fromString
(
sessionkey
),
u
);
}
@RequestMapping
(
value
=
"/session/{sessionkey}"
,
method
=
RequestMethod
.
GET
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment