- Has the ability to view their profile, edit.
- View trash coins earned.
- View leader board.
- and much more.
ROLE_ADMIN : User who are allowed to access specific route by the moderator. Normally people from the urzad.
- has the ability to view their profile, user profile, edit or deactivate certain user.
- Admin dashboard from the front end. !!Todo🤔
- has the ability to view their profile, admin profile and userProfile.
- super-user Capability.
Clone the Repo
- use
git clone
command to clone the repo.- After cloning install all maven dependency.
- setup database of your choice and add respective dependency for maven. configure
main/java/resources/application.properties
.- Run the service using the ^R (mac).
- Application starts without any errors.
Test API endpoints using POSTMAN📮
create user
POST
http://localhost:8080/user/auth/register
{
"username":"Marcin",
"email":"marcin@gmail.com",
"role":[
"user","admin","mod"
],
"password":"marcinkaminski"
}
todo : response status for now is just a string we will implement email verification to activate account later on.
login user
POST
http://localhost:8080/user/auth/signin
{
"username":"Marcin",
"password":"marcinkaminski"
}
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJNYXJjaW4iLCJpYXQiOjE2NjcxMzQ4MjksImV4cCI6MTY2NzIyMTIyOX0.DE2x_r4Ddx19JURDK1QGvUAi3150TSewZCWzsJP07d2eTHoBeHp6ggKkV0a1Ra-ovLO5Ndy8t4_IfmIYizlTXg
we store this token inside browser and each tie when we send a request, we user this token as Authorization
header as a bearer token.
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJNYXJjaW4iLCJpYXQiOjE2NjcxMzQ4MjksImV4cCI6MTY2NzIyMTIyOX0.DE2x_r4Ddx19JURDK1QGvUAi3150TSewZCWzsJP07d2eTHoBeHp6ggKkV0a1Ra-ovLO5Ndy8t4_IfmIYizlTXg
So when the request reaches the endpoint at spring backend, the custom filters, will validate the token and extracts details on authority and username.
Some routes require authorization. So depending on the ROLE specified, the user get redirected to resource or not accessible page.
created by
gokintosh🤖