Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export const authOptions: NextAuthOptions = {
],
callbacks: {
async signIn({ user, account, profile }) {
if (profile.notAllowed) {
// Set by the GitHub flow if the user does not belong to the GITHUB_ALLOWED_ORG
if ((profile as { notAllowed?: boolean }).notAllowed) {
return false
}

Expand Down
6 changes: 3 additions & 3 deletions lib/form.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { useRouter } from 'next/router'
import * as React from 'react'
import { useBeforeunload } from 'react-beforeunload'
import { FormState } from 'react-hook-form'
import type { FieldValues, FormState } from 'react-hook-form'

type Props<T> = {
type Props<T extends FieldValues> = {
formState: FormState<T>
message?: string
}

const defaultMessage = 'Are you sure to leave without saving?'

export function useLeaveConfirm<T>({
export function useLeaveConfirm<T extends FieldValues>({
formState,
message = defaultMessage,
}: Props<T>) {
Expand Down
Loading
Loading