-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Week 16: Authentication - Etna and Alma #332
Open
almaherris
wants to merge
33
commits into
Technigo:master
Choose a base branch
from
almaherris:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
5cfae3f
starting up week project; manage to create a new user
Caracal23 1892dca
completed backend part
Caracal23 e0d7677
components creation in frontend
Caracal23 6166f44
started with registration form in frontend
almaherris ec48849
login form up and running
Caracal23 c139420
logout button created
Caracal23 392e98e
set up user page
almaherris cacccdd
Merge pull request #1 from almaherris/alma-branch
almaherris cc10038
added landing page with path /
almaherris 4e428be
buttons styling
almaherris 1dc4d35
Merge pull request #2 from almaherris/alma-branch
almaherris 5238045
Merge branch 'master' into project-auth-etna
Caracal23 a90be78
Merge pull request #3 from almaherris/project-auth-etna
Caracal23 3c7bb48
css on login form and button
Caracal23 bfa9f61
added links that disappeared in merge
almaherris 1fc154f
added 403 error to backend
almaherris 51f691b
added global context for authorization
almaherris 4d733c2
fixed errors in authorization and made a to do list
almaherris e9a003e
error handling on the backend; registration form adjustments
Caracal23 1b7a759
Adding alert message and style it
Caracal23 ad512de
added logout functionality and unauthorized nimation
almaherris c3df09a
updated animation in unauthorized page
almaherris a117242
unauthorized message styling
almaherris 7e88535
fixed bug that caused 409 error for every new user
almaherris 63552f0
replaced localhost urls with deployed
almaherris 13726f7
deleted toml
almaherris 72947c4
added netlify.toml
almaherris e356e51
removed toml file again
almaherris 9fa3782
update readme
almaherris a7db3ec
added netlify toml for redirects
almaherris 46f5ea8
update todo list in readme
almaherris 10388c7
Adding case insensitive in the backend; completing the README
Caracal23 4a062b9
adding a loading state and style it
Caracal23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
# Project Auth API | ||
|
||
Replace this readme with your own information about your project. | ||
|
||
Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. | ||
In this week project we needed to create our backend with the specificatios of authenticate and user creation as well as handle passwords. | ||
Once the backend was set up, we needed to link it to an user friendly frontend. | ||
|
||
## The problem | ||
|
||
Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next? | ||
On this project the technologies that we used were Mongoose and MongoDB for the backend and for the fronted we used React Hooks, Context and Navigate. | ||
As a problem, we faced a bit of confussion on how our end-points would look in the frontend. | ||
|
||
## View it live | ||
|
||
Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about. | ||
Backend: https://bubblegum-auth.onrender.com/ | ||
Frontend: https://pink-authorization.netlify.app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[[redirects]] | ||
from = "/*" | ||
to = "/index.html" | ||
status = 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
* { | ||
box-sizing: border-box; | ||
margin: 0; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: inherit; | ||
} | ||
|
||
body { | ||
background: rgb(252, 156, 210); | ||
background: linear-gradient( | ||
157deg, | ||
rgba(252, 156, 210, 1) 16%, | ||
rgba(254, 195, 228, 1) 49%, | ||
rgba(241, 209, 227, 1) 78% | ||
); | ||
font-family: "Encode Sans Expanded", sans-serif; | ||
} | ||
|
||
button { | ||
font-family: "Encode Sans Expanded", sans-serif; | ||
margin-top: 20px; | ||
height: 30px; | ||
border-radius: 40px; | ||
border: none; | ||
background-color: #d56e90; | ||
color: white; | ||
font-weight: 500; | ||
font-size: 14px; | ||
cursor: pointer; | ||
width: 100px; | ||
} | ||
|
||
.full-width { | ||
width: 100%; | ||
} | ||
|
||
/*Common styling for back-links*/ | ||
.back-link { | ||
color: #d56e90; | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
font-size: 14px; | ||
} | ||
|
||
.back-link:hover { | ||
text-decoration: underline; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
import { BrowserRouter, Routes, Route } from "react-router-dom" | ||
import { RegistrationForm } from "./components/RegistrationForm" | ||
import { LoginForm } from "./components/LoginForm" | ||
import { UserPage } from "./components/UserPage" | ||
import { WelcomePage } from "./components/WelcomePage" | ||
import "./App.css" | ||
|
||
export const App = () => { | ||
return <div>Find me in src/app.jsx!</div>; | ||
}; | ||
return ( | ||
<div className="app-container"> | ||
<BrowserRouter> | ||
<Routes> | ||
<Route path="/" element={<WelcomePage />} /> | ||
<Route path="/registration" element={<RegistrationForm />} /> | ||
<Route path="/login" element={<LoginForm />} /> | ||
<Route path="/user-page" element={<UserPage />} /> | ||
</Routes> | ||
</BrowserRouter> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"v":"5.8.0","fr":60,"ip":0,"op":120,"w":1000,"h":1000,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 1","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[500,490,0],"to":[0,1.667,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":60,"s":[500,510,0],"to":[0,0,0],"ti":[0,1.667,0]},{"t":120,"s":[500,490,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[200,200,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":121,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"face","parent":1,"sr":1,"ks":{"o":{"a":0,"k":50,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.748,"y":0},"t":30,"s":[0,0,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.352,"y":1},"o":{"x":0.178,"y":0},"t":45,"s":[8,0,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.491,"y":1},"o":{"x":0.077,"y":0},"t":60,"s":[-8,0,0],"to":[0,0,0],"ti":[-1.333,0,0]},{"i":{"x":0.491,"y":1},"o":{"x":0.333,"y":0},"t":73,"s":[3,0,0],"to":[1.333,0,0],"ti":[0.5,0,0]},{"t":84,"s":[0,0,0]}],"ix":2,"l":2},"a":{"a":0,"k":[250,250,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.964,0],[0.926,1.269],[-2.109,1.537],[-12.421,0],[-9.638,-6.507],[1.46,-2.163],[2.164,1.463],[9.78,0],[8.382,-6.108]],"o":[[-1.46,0],[-1.537,-2.109],[10.009,-7.294],[11.67,0],[2.163,1.46],[-1.458,2.163],[-8.071,-5.448],[-10.408,0],[-0.84,0.612]],"v":[[-30.712,9.847],[-34.536,7.904],[-33.499,1.302],[0.788,-9.847],[33.361,0.099],[34.633,6.66],[28.073,7.932],[0.788,-0.396],[-27.934,8.941]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.8706,0.2078,0.4314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tr","p":{"a":0,"k":[250,273.902],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":1,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-5.22],[5.22,0],[0,5.22],[-5.22,0]],"o":[[0,5.22],[-5.22,0],[0,-5.22],[5.22,0]],"v":[[9.451,0],[0,9.451],[-9.451,0],[0,-9.451]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.8706,0.2078,0.4314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[212.197,225.702],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-5.22],[5.22,0],[0,5.22],[-5.22,0]],"o":[[0,5.22],[-5.22,0],[0,-5.22],[5.22,0]],"v":[[9.451,0],[0,9.451],[-9.451,0],[0,-9.451]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.8706,0.2078,0.4314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[287.803,225.702],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"tr","p":{"a":0,"k":[287.803,225.702],"ix":2},"a":{"a":0,"k":[287.803,225.702],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":121,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"magnification glass","parent":1,"sr":1,"ks":{"o":{"a":0,"k":50,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[27,24,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[14.17,-15.84],[0.87,-0.89],[25.14,0],[0,49.35],[-49.35,0],[0,-49.35]],"o":[[-0.82,0.93],[-16.27,16.75],[-49.35,0],[0,-49.35],[49.35,0],[0,22.88]],"v":[[39.949,35.36],[37.419,38.08],[-26.751,65.25],[-116.251,-24.25],[-26.751,-113.75],[62.749,-24.25]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[4.11,4.1],[0,0],[0,25.41],[60.93,0],[0,-60.93],[-60.93,0],[-19.48,17.2],[0,0],[-2.69,0],[-2.05,2.05]],"o":[[0,0],[14.48,-18.69],[0,-60.93],[-60.93,0],[0,60.93],[27.96,0],[0,0],[2.05,2.05],[2.69,0],[4.11,-4.1]],"v":[[134.169,116.83],[60.639,43.3],[83.749,-24.25],[-26.751,-134.75],[-137.251,-24.25],[-26.751,86.25],[46.269,58.61],[119.329,131.67],[126.749,134.75],[134.169,131.67]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.8706,0.2078,0.4314,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":121,"st":0,"bm":0}],"markers":[]} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.alert-message { | ||
padding: 8px 12px; | ||
border-radius: 4px; | ||
font-size: 13px; | ||
margin: 6px auto; | ||
} | ||
|
||
.background-error { | ||
background-color: rgba(234, 134, 133, 1); | ||
color: rgb(111, 3, 3); | ||
} | ||
|
||
.background-success { | ||
background-color: rgba(29, 209, 161, 1); | ||
color: rgb(6, 87, 67); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import PropTypes from "prop-types" | ||
import "./AlertMessage.css" | ||
|
||
export const AlertMessage = ({ type, message }) => { | ||
return ( | ||
<div | ||
className={`alert-message ${ | ||
type === "success" ? "background-success" : "background-error" | ||
}`}> | ||
<p>{message}</p> | ||
</div> | ||
) | ||
} | ||
|
||
AlertMessage.propTypes = { | ||
type: PropTypes.string.isRequired, | ||
message: PropTypes.string.isRequired, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping it DRY, I like it 😏