Skip to content

Commit

Permalink
linting concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanaz2 committed Feb 17, 2023
1 parent 1b949a3 commit 77b7035
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions app/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
Flex,
} from '@chakra-ui/react';
import { LockIcon } from '@chakra-ui/icons';
import { ActionArgs, redirect } from '@remix-run/node';
import type { ActionArgs } from '@remix-run/node';
import { redirect } from '@remix-run/node';
import { Form } from '@remix-run/react';

import { getUsername } from '~/session.server';
Expand All @@ -27,7 +28,9 @@ export const action = async ({ request }: ActionArgs) => {
return redirect(context);
}
// fallback if someone accidentally landed here and was already logged in.
if (user) return redirect('/');
if (user) {
return redirect('/');
}
};

export default function Login() {
Expand Down
3 changes: 2 additions & 1 deletion app/routes/login/callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ export const action = async ({ request }: ActionArgs) => {
let user = await getUserByUsername(username);

//If not create one
if (!user)
if (!user) {
user = await createUser(
username,
extract.attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname'],
extract.attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname'],
extract.attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress']
);
}

//Either way create a session
return createUserSession({
Expand Down
3 changes: 2 additions & 1 deletion app/routes/logout/callback.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LoaderArgs, redirect } from '@remix-run/node';
import type { LoaderArgs } from '@remix-run/node';
import { redirect } from '@remix-run/node';
import { logout } from '~/session.server';

//Logout, destroying the session with Starchart
Expand Down
2 changes: 1 addition & 1 deletion app/routes/sp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LoaderArgs } from '@remix-run/node';
import type { LoaderArgs } from '@remix-run/node';
import { metadata } from '~/saml.server';

export async function loader({ params }: LoaderArgs) {
Expand Down

0 comments on commit 77b7035

Please sign in to comment.