Skip to content

Commit

Permalink
Merge: pull request #124 from HGU-WALAB/#121/login&signup-page
Browse files Browse the repository at this point in the history
#121/login&signup page
  • Loading branch information
healim01 authored Jan 25, 2024
2 parents df9c5c3 + bbf4db0 commit e8b9d3a
Show file tree
Hide file tree
Showing 41 changed files with 145 additions and 99 deletions.
Binary file removed public/favicon/android-chrome-192x192.png
Binary file not shown.
Binary file removed public/favicon/android-chrome-512x512.png
Binary file not shown.
Binary file added public/favicon/android-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/favicon/apple-touch-icon.png
Binary file not shown.
2 changes: 2 additions & 0 deletions public/favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file modified public/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions public/favicon/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
Binary file added public/favicon/ms-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/ms-icon-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/ms-icon-310x310.png
Binary file added public/favicon/ms-icon-70x70.png
23 changes: 18 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,24 @@
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

<!-- Favicon -->
<link rel="icon" href="%PUBLIC_URL%/favicon/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon/favicon-32x32.png">
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/favicon/apple-touch-icon.png">

<link rel="apple-touch-icon" sizes="57x57" href="/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">

<!-- Using Google Font -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
Expand Down
24 changes: 9 additions & 15 deletions src/auth/context/jwt/auth-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ type Payload = {
[Types.LOGIN]: {
user: AuthUserType;
};
[Types.REGISTER]: {
user: AuthUserType;
};
[Types.REGISTER]: undefined;

[Types.LOGOUT]: undefined;
};

Expand Down Expand Up @@ -61,7 +60,7 @@ const reducer = (state: AuthStateType, action: ActionsType) => {
if (action.type === Types.REGISTER) {
return {
...state,
user: action.payload.user,
user: null,
};
}
if (action.type === Types.LOGOUT) {
Expand Down Expand Up @@ -154,28 +153,23 @@ export function AuthProvider({ children }: Props) {

// REGISTER
const register = useCallback(
async (email: string, password: string, firstName: string, lastName: string) => {
async (name: string, s_id: string, deptName: string, email: string, password: string) => {
const data = {
name,
s_id,
deptName,
email,
password,
firstName,
lastName,
};

const res = await axiosInstance.post(endpoints.auth.register, data);

const { accessToken, user } = res.data;
// const { accessToken, user } = res.data;

sessionStorage.setItem(STORAGE_KEY, accessToken);
// sessionStorage.setItem(STORAGE_KEY, accessToken);

dispatch({
type: Types.REGISTER,
payload: {
user: {
...user,
accessToken,
},
},
});
},
[]
Expand Down
30 changes: 22 additions & 8 deletions src/auth/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export type AuthStateType = {
type CanRemove = {
login?: (email: string, password: string) => Promise<void>;
register?: (
name: string,
s_id: string,
deptName: string,
email: string,
password: string,
firstName: string,
lastName: string
password: string
) => Promise<void>;
//
loginWithGoogle?: () => Promise<void>;
Expand All @@ -52,7 +53,13 @@ export type JWTContextType = CanRemove & {
authenticated: boolean;
unauthenticated: boolean;
login: (email: string, password: string) => Promise<void>;
register: (email: string, password: string, firstName: string, lastName: string) => Promise<void>;
register: (
name: string,
s_id: string,
deptName: string,
email: string,
password: string
) => Promise<void>;
logout: () => Promise<void>;
};

Expand All @@ -68,7 +75,13 @@ export type FirebaseContextType = CanRemove & {
loginWithTwitter: () => Promise<void>;
forgotPassword?: (email: string) => Promise<void>;
login: (email: string, password: string) => Promise<void>;
register: (email: string, password: string, firstName: string, lastName: string) => Promise<void>;
register: (
name: string,
s_id: string,
deptName: string,
email: string,
password: string
) => Promise<void>;
};

export type AmplifyContextType = CanRemove & {
Expand All @@ -79,10 +92,11 @@ export type AmplifyContextType = CanRemove & {
unauthenticated: boolean;
login: (email: string, password: string) => Promise<unknown>;
register: (
name: string,
s_id: string,
deptName: string,
email: string,
password: string,
firstName: string,
lastName: string
password: string
) => Promise<unknown>;
logout: () => Promise<unknown>;
confirmRegister: (email: string, code: string) => Promise<void>;
Expand Down
12 changes: 0 additions & 12 deletions src/layouts/auth/classic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ export default function AuthClassicLayout({ children, image, title }: Props) {
{title || 'Hi, Welcome To Hanspace'}
</Typography>

{/* <Box
component="img"
alt="auth"
src={image || '/assets/illustrations/illustration_dashboard.png'}
sx={{
maxWidth: {
xs: 480,
lg: 560,
xl: 720,
},
}}
/> */}
<Box
component="img"
alt="auth"
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/dashboard/dept-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default function DeptHeaderButton() {
onClick={(event) => handleGOAddDept(event)}
>
<DeptButton>
<Rows>
<Container>
<Avatar
alt="+"
color="primary.pale"
Expand All @@ -208,7 +208,7 @@ export default function DeptHeaderButton() {
+ {/* TODO : 아바타 이후에 수정하기 */}
</Avatar>
새 기관 추가하기
</Rows>
</Container>
</DeptButton>
</MenuItem>
</Menu>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/auth/jwt/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function RegisterPage() {
return (
<>
<Helmet>
<title> Jwt: Register</title>
<title> HANSPACE: 회원가입</title>
</Helmet>

<JwtRegisterView />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/sections/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const authJwt = {
{
path: 'register',
element: (
<AuthClassicLayout title="Manage the job more effectively with Minimal">
<AuthClassicLayout>
<JwtRegisterPage />
</AuthClassicLayout>
),
Expand Down
2 changes: 1 addition & 1 deletion src/sections/auth/jwt/jwt-login-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function JwtLoginView() {
<Typography variant="body2">회원이 아니세요?</Typography>

<Link component={RouterLink} href={paths.auth.jwt.register} variant="subtitle2">
회원가입
회원가입하기
</Link>
</Stack>
</Stack>
Expand Down
Loading

0 comments on commit e8b9d3a

Please sign in to comment.