@snokam/auth 3.2.2 → 3.3.1
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.
- package/CHANGELOG.md +10 -0
- package/package.json +5 -5
- package/src/components/Error/index.tsx +48 -60
- package/src/components/Error/styled.tsx +7 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.3.1](https://github.com/snokam/components/compare/@snokam/auth@3.3.0...@snokam/auth@3.3.1) (2026-10-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @snokam/auth
|
|
9
|
+
|
|
10
|
+
# [3.3.0](https://github.com/snokam/components/compare/@snokam/auth@3.2.2...@snokam/auth@3.3.0) (2026-10-03)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **pages:** blobs on every centred-box page, readable consent card, full integration names ([#2566](https://github.com/snokam/components/issues/2566)) ([6076941](https://github.com/snokam/components/commit/60769412cc3a1cfd2d239d2377d71a622fb99f94))
|
|
15
|
+
|
|
6
16
|
## [3.2.2](https://github.com/snokam/components/compare/@snokam/auth@3.2.1...@snokam/auth@3.2.2) (2026-10-02)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @snokam/auth
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snokam/auth",
|
|
3
3
|
"description": "Snøkam auth components",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.1",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
7
7
|
"files": [
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"@snokam/employees-client": "^1.3.0",
|
|
26
26
|
"next-auth": "4.24.15",
|
|
27
27
|
"path-to-regexp": "^8.4.2",
|
|
28
|
-
"@snokam/
|
|
28
|
+
"@snokam/identity": "1.1.0",
|
|
29
|
+
"@snokam/platform-client": "3.3.0",
|
|
29
30
|
"@snokam/react-query": "1.1.0",
|
|
30
|
-
"@snokam/
|
|
31
|
-
"@snokam/
|
|
32
|
-
"@snokam/identity": "1.1.0"
|
|
31
|
+
"@snokam/tenant": "2.1.5",
|
|
32
|
+
"@snokam/ui": "2.1.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"next": "16.3.3",
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import Styled from "./styled";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Alert, Avatar } from "@snokam/ui";
|
|
6
|
+
import { SystemPage } from "@snokam/ui/system-page";
|
|
7
|
+
import { ThemeScope } from "@snokam/ui/theme";
|
|
7
8
|
import { useAuth } from "../../hooks";
|
|
8
9
|
import { useOptionalConfig } from "@snokam/tenant";
|
|
9
|
-
import Button from "@mui/material/Button";
|
|
10
|
-
import { Avatar, Alert } from "@mui/material";
|
|
11
10
|
|
|
12
11
|
export interface ErrorPageProps {
|
|
13
12
|
message?: ReactNode;
|
|
@@ -28,62 +27,51 @@ export const Error = ({
|
|
|
28
27
|
const isProd = config?.NEXT_PUBLIC_ENVIRONMENT === "p";
|
|
29
28
|
|
|
30
29
|
return (
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
callbackUrl: "/auth/login?callbackUrl=/&prompt=login",
|
|
77
|
-
});
|
|
78
|
-
}}
|
|
79
|
-
>
|
|
80
|
-
Logg inn på nytt
|
|
81
|
-
</Button>
|
|
82
|
-
)}
|
|
83
|
-
</Styled.Wrapper>
|
|
84
|
-
</Styled.Section>
|
|
85
|
-
</Layout.Content>
|
|
86
|
-
</Styled.Container>
|
|
30
|
+
<SystemPage>
|
|
31
|
+
<ThemeScope theme="light" as={Styled.Wrapper}>
|
|
32
|
+
<Styled.Heading>{heading ?? "Oops! Noe gikk galt."}</Styled.Heading>
|
|
33
|
+
<Styled.Illustration
|
|
34
|
+
src="https://ressurser.snokam.no/figures/snowman.svg"
|
|
35
|
+
alt="Feil illustrasjon"
|
|
36
|
+
/>
|
|
37
|
+
<Styled.Description>
|
|
38
|
+
{message ?? (
|
|
39
|
+
<>
|
|
40
|
+
En uventet feil har oppstått.
|
|
41
|
+
<br />
|
|
42
|
+
Prøv igjen, eller logg inn på nytt.
|
|
43
|
+
</>
|
|
44
|
+
)}
|
|
45
|
+
</Styled.Description>
|
|
46
|
+
{session && session.user && (
|
|
47
|
+
<Styled.User>
|
|
48
|
+
<Avatar src={session.user.image ?? undefined} />
|
|
49
|
+
Logget inn som: {session.user.name}
|
|
50
|
+
<br />({session.user.email})
|
|
51
|
+
</Styled.User>
|
|
52
|
+
)}
|
|
53
|
+
{!isProd && (
|
|
54
|
+
<Alert severity="warning">
|
|
55
|
+
Du er i test! Husk at det kun er mulig å logge inn <br />
|
|
56
|
+
med en av våre testbrukere som du finner i 1Password.
|
|
57
|
+
</Alert>
|
|
58
|
+
)}
|
|
59
|
+
{action}
|
|
60
|
+
{!hideRetryButton && (
|
|
61
|
+
<Styled.RetryButton
|
|
62
|
+
color="primary"
|
|
63
|
+
variant={action ? "outlined" : "contained"}
|
|
64
|
+
onClick={() => {
|
|
65
|
+
signOut({
|
|
66
|
+
callbackUrl: "/auth/login?callbackUrl=/&prompt=login",
|
|
67
|
+
});
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
Logg inn på nytt
|
|
71
|
+
</Styled.RetryButton>
|
|
72
|
+
)}
|
|
73
|
+
</ThemeScope>
|
|
74
|
+
</SystemPage>
|
|
87
75
|
);
|
|
88
76
|
};
|
|
89
77
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const Container = styled(Layout.Container)`
|
|
5
|
-
flex: 1;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
`;
|
|
2
|
+
import { Button } from "@snokam/ui";
|
|
8
3
|
|
|
9
4
|
const Wrapper = styled.div`
|
|
10
5
|
display: flex;
|
|
@@ -17,6 +12,7 @@ const Wrapper = styled.div`
|
|
|
17
12
|
background-color: var(--color-dark-green);
|
|
18
13
|
border-radius: 1rem;
|
|
19
14
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.9);
|
|
15
|
+
color: var(--color-primary);
|
|
20
16
|
`;
|
|
21
17
|
|
|
22
18
|
const Heading = styled.h1`
|
|
@@ -31,13 +27,6 @@ const Illustration = styled.img`
|
|
|
31
27
|
height: auto;
|
|
32
28
|
`;
|
|
33
29
|
|
|
34
|
-
const Section = styled(Layout.Section)`
|
|
35
|
-
display: flex;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
align-items: center;
|
|
38
|
-
color: var(--color-light-blue);
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
30
|
const Description = styled.div`
|
|
42
31
|
display: flex;
|
|
43
32
|
font-size: 1.15rem;
|
|
@@ -52,12 +41,15 @@ const User = styled.div`
|
|
|
52
41
|
gap: 1rem;
|
|
53
42
|
`;
|
|
54
43
|
|
|
44
|
+
const RetryButton = styled(Button)`
|
|
45
|
+
margin-top: 24px;
|
|
46
|
+
`;
|
|
47
|
+
|
|
55
48
|
export default {
|
|
56
|
-
Container,
|
|
57
49
|
Wrapper,
|
|
58
50
|
Heading,
|
|
59
51
|
Illustration,
|
|
60
52
|
Description,
|
|
61
|
-
Section,
|
|
62
53
|
User,
|
|
54
|
+
RetryButton,
|
|
63
55
|
};
|