created auth system
This commit is contained in:
20
src/app/models/auth.model.ts
Normal file
20
src/app/models/auth.model.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export interface AuthSession {
|
||||
sessionId: string;
|
||||
telegramUserId: number;
|
||||
username: string | null;
|
||||
displayName: string;
|
||||
active: boolean;
|
||||
expiresAt: string;
|
||||
}
|
||||
|
||||
export interface TelegramAuthData {
|
||||
id: number;
|
||||
first_name: string;
|
||||
last_name?: string;
|
||||
username?: string;
|
||||
photo_url?: string;
|
||||
auth_date: number;
|
||||
hash: string;
|
||||
}
|
||||
|
||||
export type AuthStatus = 'unknown' | 'checking' | 'authenticated' | 'expired' | 'unauthenticated';
|
||||
@@ -1,2 +1,4 @@
|
||||
export * from './category.model';
|
||||
export * from './item.model';
|
||||
export * from './location.model';
|
||||
export * from './auth.model';
|
||||
|
||||
17
src/app/models/location.model.ts
Normal file
17
src/app/models/location.model.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface Region {
|
||||
id: string;
|
||||
city: string;
|
||||
country: string;
|
||||
countryCode: string;
|
||||
timezone?: string;
|
||||
}
|
||||
|
||||
export interface GeoIpResponse {
|
||||
city: string;
|
||||
country: string;
|
||||
countryCode: string;
|
||||
region?: string;
|
||||
timezone?: string;
|
||||
lat?: number;
|
||||
lon?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user