Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SkuciSe
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tim 2 - 2022
SkuciSe
Commits
fe7e995c
Commit
fe7e995c
authored
Sep 01, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if logged login register
parent
349ee492
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppController.java
+7
-2
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/controller/AppController.java
View file @
fe7e995c
...
...
@@ -26,14 +26,18 @@ public class AppController
}
@GetMapping
(
"/login"
)
public
String
getLogin
(
Model
model
)
public
String
getLogin
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
if
(
loggedUser
!=
null
)
return
"redirect:/index"
;
return
(
"login"
);
}
@GetMapping
(
"/register"
)
public
String
getRegister
(
Model
model
)
public
String
getRegister
(
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
if
(
loggedUser
!=
null
)
return
"redirect:/index"
;
model
.
addAttribute
(
"newUser"
,
new
Korisnik
());
return
(
"register"
);
}
...
...
@@ -45,6 +49,7 @@ public class AppController
kRepo
.
insert
(
korisnik
);
return
(
"redirect:/login"
);
}
@GetMapping
(
"/profile/{korisnikid}"
)
public
String
getProfile
(
@PathVariable
(
"korisnikid"
)
int
korisnikid
,
Model
model
,
@AuthenticationPrincipal
KorisnikDetails
korisnik
)
{
...
...
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