uibee 1.6.4 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  import { LoginPageProps } from 'uibee/components';
2
- export default function LoginPage({ title, description, redirectURI, version, btg, handleSubmit }: LoginPageProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function LoginPage({ title, description, redirectURL, version, btg, handleSubmit }: LoginPageProps): import("react/jsx-runtime").JSX.Element;
@@ -3,12 +3,12 @@ import { LogIn } from 'lucide-react';
3
3
  import Link from 'next/link';
4
4
  import Image from 'next/image';
5
5
  import logo from '../../../images/logo-tekst-white.svg';
6
- export default function LoginPage({ title, description, redirectURI, version, btg, handleSubmit }) {
6
+ export default function LoginPage({ title, description, redirectURL, version, btg, handleSubmit }) {
7
7
  return (_jsx("main", { className: 'min-h-screen flex items-center justify-center bg-login-900 p-8', children: _jsxs("div", { className: 'flex flex-col justify-center items-center bg-login-600 px-4 py-12 rounded-xl w-full max-w-md gap-4 md:gap-6', children: [_jsx("div", { className: 'relative aspect-[3/1] w-full', children: _jsx(Image, { src: logo, alt: 'Logo', fill: true, className: 'object-contain sm:px-12' }) }), _jsxs("h1", { className: 'text-3xl font-extrabold text-login text-center tracking-tight', children: [title, " ", btg ? ' - Break the Glass' : ''] }), description && (_jsx("p", { className: 'text-login-100 text-center font-medium text-lg mb-2 max-w-xs', children: description })), btg ? (_jsxs("form", { className: 'w-full flex flex-col gap-3 max-w-xs', onSubmit: e => {
8
8
  e.preventDefault();
9
9
  handleSubmit?.(new FormData(e.currentTarget));
10
10
  e.currentTarget.reset();
11
11
  }, children: [_jsx("input", { type: 'text', name: 'name', placeholder: 'Name', className: 'py-2 px-3 rounded bg-login-900 text-login-50 font-medium focus:outline-none', required: true }), _jsx("input", { type: 'password', name: 'token', placeholder: 'Token', className: 'py-2 px-3 rounded bg-login-900 text-login-50 font-medium focus:outline-none', required: true }), _jsx("button", { type: 'submit', className: 'py-2 px-4 rounded-xl bg-login font-bold text-lg ' +
12
- 'hover:bg-login/80 text-login-50 transition-all duration-200 mt-2', children: "Login" })] })) : (_jsx(Link, { href: redirectURI, className: 'w-full flex justify-center', children: _jsxs("button", { className: 'flex items-center justify-center gap-2 w-full max-w-xs py-3 px-6 rounded-xl bg-login font-bold text-lg ' +
12
+ 'hover:bg-login/80 text-login-50 transition-all duration-200 mt-2', children: "Login" })] })) : (_jsx(Link, { href: redirectURL, className: 'w-full flex justify-center', children: _jsxs("button", { className: 'flex items-center justify-center gap-2 w-full max-w-xs py-3 px-6 rounded-xl bg-login font-bold text-lg ' +
13
13
  'hover:bg-login/80 text-login-50 transition-all duration-200 mb-2 mt-2', children: ["Login", _jsx(LogIn, { className: 'w-6 h-6' })] }) })), _jsxs("span", { className: 'text-login-100 text-sm mt-2', children: ["v", version] })] }) }));
14
14
  }
@@ -1,2 +1,2 @@
1
1
  import type { AuthCallbackProps } from 'uibee/utils';
2
- export default function authCallback({ req, tokenURL, clientID, clientSecret, redirectURI, userInfoURL, tokenRedirectURL }: AuthCallbackProps): Promise<Response>;
2
+ export default function authCallback({ req, tokenURL, clientID, clientSecret, redirectURL, userInfoURL, tokenRedirectURL }: AuthCallbackProps): Promise<Response>;
@@ -1,5 +1,5 @@
1
1
  import { NextResponse } from 'next/server';
2
- export default async function authCallback({ req, tokenURL, clientID, clientSecret, redirectURI, userInfoURL, tokenRedirectURL }) {
2
+ export default async function authCallback({ req, tokenURL, clientID, clientSecret, redirectURL, userInfoURL, tokenRedirectURL }) {
3
3
  const searchParams = new URL(req.url).searchParams;
4
4
  if (!searchParams) {
5
5
  return NextResponse.json({ error: 'No search parameters found.' }, { status: 400 });
@@ -17,7 +17,7 @@ export default async function authCallback({ req, tokenURL, clientID, clientSecr
17
17
  client_id: clientID,
18
18
  client_secret: clientSecret,
19
19
  code: code,
20
- redirect_uri: redirectURI,
20
+ redirect_url: redirectURL,
21
21
  grant_type: 'authorization_code',
22
22
  }).toString()
23
23
  });
@@ -1,3 +1,3 @@
1
1
  import { NextResponse } from 'next/server';
2
2
  import type { AuthLoginProps } from 'uibee/utils';
3
- export default function AuthLogin({ clientID, redirectURI, authURL }: AuthLoginProps): Promise<NextResponse<unknown>>;
3
+ export default function AuthLogin({ clientID, redirectURL, authURL }: AuthLoginProps): Promise<NextResponse<unknown>>;
@@ -1,9 +1,9 @@
1
1
  import { NextResponse } from 'next/server';
2
- export default async function AuthLogin({ clientID, redirectURI, authURL }) {
2
+ export default async function AuthLogin({ clientID, redirectURL, authURL }) {
3
3
  const state = Math.random().toString(36).substring(5);
4
4
  const authQueryParams = new URLSearchParams({
5
5
  client_id: clientID,
6
- redirect_uri: redirectURI,
6
+ redirect_url: redirectURL,
7
7
  response_type: 'code',
8
8
  scope: 'openid profile email',
9
9
  state: state,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uibee",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "description": "Shared components, functions and hooks for reuse across Login projects",
5
5
  "homepage": "https://github.com/Login-Linjeforening-for-IT/uibee#readme",
6
6
  "bugs": {
@@ -4,7 +4,7 @@ import Link from 'next/link'
4
4
  import Image from 'next/image'
5
5
  import logo from '@images/logo-tekst-white.svg'
6
6
 
7
- export default function LoginPage({title, description, redirectURI, version, btg, handleSubmit}: LoginPageProps) {
7
+ export default function LoginPage({title, description, redirectURL, version, btg, handleSubmit}: LoginPageProps) {
8
8
  return (
9
9
  <main className='min-h-screen flex items-center justify-center bg-login-900 p-8'>
10
10
  <div
@@ -62,7 +62,7 @@ export default function LoginPage({title, description, redirectURI, version, btg
62
62
  </button>
63
63
  </form>
64
64
  ) : (
65
- <Link href={redirectURI} className='w-full flex justify-center'>
65
+ <Link href={redirectURL} className='w-full flex justify-center'>
66
66
  <button
67
67
  className={
68
68
  'flex items-center justify-center gap-2 w-full max-w-xs py-3 px-6 rounded-xl bg-login font-bold text-lg ' +
@@ -3,7 +3,7 @@ declare module 'uibee/components' {
3
3
  export interface LoginPageProps {
4
4
  title: string
5
5
  description?: string
6
- redirectURI: string
6
+ redirectURL: string
7
7
  version: string
8
8
  btg?: boolean
9
9
  handleSubmit?: (formData: FormData) => void
@@ -33,7 +33,7 @@ declare module 'uibee/utils' {
33
33
 
34
34
  export interface AuthLoginProps {
35
35
  clientID: string
36
- redirectURI: string
36
+ redirectURL: string
37
37
  authURL: string
38
38
  }
39
39
 
@@ -42,7 +42,7 @@ declare module 'uibee/utils' {
42
42
  tokenURL: string
43
43
  clientID: string
44
44
  clientSecret: string
45
- redirectURI: string
45
+ redirectURL: string
46
46
  userInfoURL: string
47
47
  tokenRedirectURL: string
48
48
  }
@@ -13,7 +13,7 @@ export default async function authCallback({
13
13
  tokenURL,
14
14
  clientID,
15
15
  clientSecret,
16
- redirectURI,
16
+ redirectURL,
17
17
  userInfoURL,
18
18
  tokenRedirectURL
19
19
  }: AuthCallbackProps) {
@@ -37,7 +37,7 @@ export default async function authCallback({
37
37
  client_id: clientID,
38
38
  client_secret: clientSecret,
39
39
  code: code as string,
40
- redirect_uri: redirectURI,
40
+ redirect_url: redirectURL,
41
41
  grant_type: 'authorization_code',
42
42
  }).toString()
43
43
  })
@@ -1,11 +1,11 @@
1
1
  import { NextResponse } from 'next/server'
2
2
  import type { AuthLoginProps } from 'uibee/utils'
3
3
 
4
- export default async function AuthLogin({ clientID, redirectURI, authURL }: AuthLoginProps) {
4
+ export default async function AuthLogin({ clientID, redirectURL, authURL }: AuthLoginProps) {
5
5
  const state = Math.random().toString(36).substring(5)
6
6
  const authQueryParams = new URLSearchParams({
7
7
  client_id: clientID,
8
- redirect_uri: redirectURI,
8
+ redirect_url: redirectURL,
9
9
  response_type: 'code',
10
10
  scope: 'openid profile email',
11
11
  state: state,