Skip to content

Commit ce3d3c3

Browse files
feat(client): new and refreshed UI for all auth pages (#12)
1 parent 6d58b99 commit ce3d3c3

25 files changed

+3099
-1419
lines changed

.github/public/login.png

178 KB
Loading

.github/public/register.png

173 KB
Loading

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,8 @@ When ready, read the [Launch Guide](https://docs.authcompanion.com/guide/launch.
119119

120120
### Web Forms for Authentication
121121

122-
Authcompanion provides built-in web forms for user authentiation.
122+
Authcompanion provides built-in web forms for user authentiation including both login and registration pages below:
123123

124-
The web forms use CSS-in-JS - making them easily customizable for
125-
your specific branding and authentication needs. No build step required to make
126-
changes to the Web Form's look and feel.
127124

128125
| Login Screen | Registration Screen |
129126
| :----------------------------------: | :----------------------------------------: |
File renamed without changes.
File renamed without changes.

client/auth/homePage.html

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="stylesheet" href="/v1/web/styles/main.css" />
7+
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
8+
<style>
9+
html {
10+
font-family: "Inter var", sans-serif;
11+
}
12+
[v-cloak] {
13+
display: none;
14+
}
15+
</style>
16+
17+
<title>Home</title>
18+
</head>
19+
<body id="app">
20+
<!-- Form -->
21+
<div class="max-w-screen-xl px-4 py-16 mx-auto sm:px-6 lg:px-8">
22+
<div class="max-w-lg mx-auto">
23+
<form
24+
@submit.prevent
25+
action=""
26+
class="p-4 mt-6 mb-0 rounded-lg shadow-lg sm:p-6 lg:p-8"
27+
>
28+
<p class="text-2xl text-green-500">Success 🎉 !</p>
29+
<p class="py-3 text-black">
30+
Nice job getting started with AuthCompanion.
31+
</p>
32+
33+
<p class="pt-8 text-black">
34+
When you're ready, tell AuthC to redirect users after successful
35+
login to your application's home page (instead of this temporary
36+
one).
37+
</p>
38+
39+
<p class="py-3 text-black">
40+
For a full guide on how to integrate and launch AuthCompanion, check
41+
those sections in the docs:
42+
<a
43+
class="text-blue-600 underline hover:text-blue-800"
44+
href="https://docs.authcompanion.com/"
45+
>https://docs.authcompanion.com/</a
46+
>
47+
</p>
48+
49+
<p class="text-black">
50+
After a successful login or account registration, AuthC provides
51+
developers a user's access token which is used for managing your
52+
user's session. The access token contains helpful information about
53+
the user.
54+
<a
55+
class="text-blue-600 underline hover:text-blue-800"
56+
:href="jwtDebugUrl"
57+
>Decode the token's payload here to find out.</a
58+
>
59+
</p>
60+
<br />
61+
</form>
62+
</div>
63+
</div>
64+
<div class="fixed inset-x-0 bottom-0">
65+
<div class="m-4 text-xs text-gray-400">
66+
Powered by
67+
<span class="underline">
68+
<a href="https://github.com/authcompanion/authcompanion2"
69+
>AuthCompanion</a
70+
>
71+
</span>
72+
</div>
73+
</div>
74+
<!-- Scripts -->
75+
<script type="module">
76+
import {
77+
createApp,
78+
ref,
79+
computed,
80+
} from "https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.esm-browser.prod.js";
81+
82+
createApp({
83+
setup() {
84+
const email = ref("");
85+
const password = ref("");
86+
87+
const showError = ref(false);
88+
let errorTitle = ref(null);
89+
let errorDetail = ref(null);
90+
91+
let jwt = ref("");
92+
let jwtDebugUrl = ref("");
93+
94+
jwt.value = window.localStorage.getItem("ACCESS_TOKEN");
95+
96+
if (jwt) {
97+
let jwtURL = "https://jwt.io/#debugger-io?token=" + jwt.value;
98+
jwtDebugUrl.value = jwtURL;
99+
} else {
100+
showError.value = true;
101+
102+
errorTitle.value = "Error";
103+
errorDetail.value = "Please try logging in again at /login";
104+
}
105+
106+
// expose to the html template
107+
return {
108+
showError,
109+
errorTitle,
110+
errorDetail,
111+
jwt,
112+
jwtDebugUrl,
113+
};
114+
},
115+
}).mount("#app");
116+
</script>
117+
</body>
118+
</html>

0 commit comments

Comments
 (0)