-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.ts
85 lines (73 loc) · 2.18 KB
/
routes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
77
78
79
80
81
82
83
84
85
/**
* Uygulamanın url adresi.
*/
const domain = process.env.NEXT_PUBLIC_APP_URL;
/**
* Authentication konumlarında kullanılacak olan ön ek (prefix)
* Bu ön ek ile başlayan konumlar auth için kullanılacak
* @type {string}
*/
export const AuthApiPrefix = "/api/auth";
/**
* Giriş yapan kullanıcının yönlendirileceği adres:
* @type {string}
*/
export const DEFAULT_AFTERLOGIN_REDIRECT = "/settings";
/**
* Kullanıcıların giriş yaparken kullanacağı adres
* @type {string}
*/
export const DEFAULT_LOGIN_ADRESS = "/auth/login";
/**
* Kullanıcıların kayıt olurken kullanacağı adres
* @type {string}
*/
export const DEFAULT_REGISTER_ADRESS = "/auth/register";
/**
* Kullanıcıların hata ile karşılaştığında göreceği adres
* @type {string}
*/
export const DEFAULT_ERROR_ADRESS = "/auth/error";
/**
* Kullanıcıların çıkış yaptığında gideceği
* @type {string}
*/
export const DEFAULT_LOGOUT_ADRESS = "/auth/logout";
/**
* Kullanıcıların parola sıfırlama yapacağında kullanacağı adres
* @type {string}
*/
export const DEFAULT_PASSWORD_RESET_ADRESS = "/auth/reset";
/**
* Public olarak ulaşılabilecek konumların liste kümesi
* Bu konumlar auth istenmeden ulaşılabilir
* @type {string[]}
*/
export const PublicRoutes = [
"/", // landing page (direkt olarak domain)
// Doğrulama kısmına giriş yapmış / yapmamış herhangi birisi ulaşabilir.
"/auth/new-verification"
];
/**
* Authentication için kullanılacak olan konumlar (routes)
* Bu konumlar zaten giriş yapmış olan kullanıcıları "/settings" konumumuna yönlendiricektir.
* @type {string[]}
*/
export const AuthRoutes = [
DEFAULT_LOGIN_ADRESS,
DEFAULT_REGISTER_ADRESS,
DEFAULT_ERROR_ADRESS,
DEFAULT_PASSWORD_RESET_ADRESS,
// Şifre SIFIRLAMA (unutma) kısmına sadece ÇIKIŞ yapmış kullanıcı erişebilir.
"/auth/new-password"
];
/**
* Doğrulama token'i için kullanılacak konum (url)
* @type {string}
*/
export const VerificationTokenURL = domain + "/auth/new-verification?token=";
/**
* Parola sıfırlama token'i için kullanılacak konum (url)
* @type {string}
*/
export const PasswordResetTokenURL = domain + "/auth/new-password?token=";