Google Login frontend
This commit is contained in:
@@ -17,6 +17,7 @@ dependencies {
|
|||||||
implementation project(':capacitor-keyboard')
|
implementation project(':capacitor-keyboard')
|
||||||
implementation project(':capacitor-preferences')
|
implementation project(':capacitor-preferences')
|
||||||
implementation project(':capacitor-status-bar')
|
implementation project(':capacitor-status-bar')
|
||||||
|
implementation project(':codetrix-studio-capacitor-google-auth')
|
||||||
implementation "com.onesignal:OneSignal:5.0.0-beta4"
|
implementation "com.onesignal:OneSignal:5.0.0-beta4"
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,5 @@
|
|||||||
<string name="custom_url_scheme">com.wrenchboard.users</string>
|
<string name="custom_url_scheme">com.wrenchboard.users</string>
|
||||||
<string name="facebook_app_id">390204307987009</string>
|
<string name="facebook_app_id">390204307987009</string>
|
||||||
<string name="facebook_client_token">70e8f7ea883417e96f137e0bd025bfce</string>
|
<string name="facebook_client_token">70e8f7ea883417e96f137e0bd025bfce</string>
|
||||||
|
<string name="server_client_id">817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -25,3 +25,6 @@ project(':capacitor-preferences').projectDir = new File('../node_modules/@capaci
|
|||||||
|
|
||||||
include ':capacitor-status-bar'
|
include ':capacitor-status-bar'
|
||||||
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
|
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
|
||||||
|
|
||||||
|
include ':codetrix-studio-capacitor-google-auth'
|
||||||
|
project(':codetrix-studio-capacitor-google-auth').projectDir = new File('../node_modules/@codetrix-studio/capacitor-google-auth/android')
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"appId": "com.wrenchboard.users",
|
||||||
|
"appName": "WrenchBoard",
|
||||||
|
"webDir": "www",
|
||||||
|
"bundledWebRuntime": false,
|
||||||
|
"plugins": {
|
||||||
|
"GoogleAuth": {
|
||||||
|
"scopes": ["profile","email"],
|
||||||
|
"clientId": "817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com",
|
||||||
|
"serverClientId": "817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com",
|
||||||
|
"forceCodeForRefreshToken": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
-1
@@ -4,7 +4,15 @@ const config: CapacitorConfig = {
|
|||||||
appId: 'com.wrenchboard.users',
|
appId: 'com.wrenchboard.users',
|
||||||
appName: 'WrenchBoard',
|
appName: 'WrenchBoard',
|
||||||
webDir: 'www',
|
webDir: 'www',
|
||||||
bundledWebRuntime: false
|
bundledWebRuntime: false,
|
||||||
|
plugins: {
|
||||||
|
GoogleAuth: {
|
||||||
|
scopes: ['profile', 'email'],
|
||||||
|
clientId: '817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com',
|
||||||
|
serverClientId: '817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com',
|
||||||
|
forceCodeForRefreshToken: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSCameraUsageDescription</key>
|
|
||||||
<string>Scan QR Code to login</string>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
@@ -25,18 +23,19 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleURLSchemes</key>
|
<key>CFBundleURLSchemes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>fb677857427521030</string>
|
<string>fb390204307987009</string>
|
||||||
|
<string>com.googleusercontent.apps.817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
<key>FacebookAppID</key>
|
<key>FacebookAppID</key>
|
||||||
<string>677857427521030</string>
|
<string>390204307987009</string>
|
||||||
<key>FacebookClientToken</key>
|
<key>FacebookClientToken</key>
|
||||||
<string>a6fb48571d9dd9fe5f3454b1ae2401e2</string>
|
<string>70e8f7ea883417e96f137e0bd025bfce</string>
|
||||||
<key>FacebookDisplayName</key>
|
<key>FacebookDisplayName</key>
|
||||||
<string>wrenchboard.com - development</string>
|
<string>WrenchBoard</string>
|
||||||
<key>LSApplicationQueriesSchemes</key>
|
<key>LSApplicationQueriesSchemes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>fbapi</string>
|
<string>fbapi</string>
|
||||||
@@ -57,6 +56,8 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSCameraUsageDescription</key>
|
||||||
|
<string>Scan QR Code to login</string>
|
||||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||||
<string>We need to enable geotagging to send you notifications and messages based on your location, so you will get the relevant ones only</string>
|
<string>We need to enable geotagging to send you notifications and messages based on your location, so you will get the relevant ones only</string>
|
||||||
<key>NSLocationAlwaysUsageDescription</key>
|
<key>NSLocationAlwaysUsageDescription</key>
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use_frameworks!
|
|||||||
# Requires CocoaPods 1.6 or newer
|
# Requires CocoaPods 1.6 or newer
|
||||||
install! 'cocoapods', :disable_input_output_paths => true
|
install! 'cocoapods', :disable_input_output_paths => true
|
||||||
|
|
||||||
|
gem 'activesupport', '~> 7.0', '<= 7.0.8'
|
||||||
|
|
||||||
def capacitor_pods
|
def capacitor_pods
|
||||||
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
||||||
@@ -19,6 +21,7 @@ def capacitor_pods
|
|||||||
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
|
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
|
||||||
pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
|
pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
|
||||||
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
|
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
|
||||||
|
pod 'CodetrixStudioCapacitorGoogleAuth', :path => '../../node_modules/@codetrix-studio/capacitor-google-auth'
|
||||||
pod 'CordovaPluginsStatic', :path => '../capacitor-cordova-ios-plugins'
|
pod 'CordovaPluginsStatic', :path => '../capacitor-cordova-ios-plugins'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+31
-2
@@ -1,4 +1,10 @@
|
|||||||
PODS:
|
PODS:
|
||||||
|
- AppAuth (1.6.2):
|
||||||
|
- AppAuth/Core (= 1.6.2)
|
||||||
|
- AppAuth/ExternalUserAgent (= 1.6.2)
|
||||||
|
- AppAuth/Core (1.6.2)
|
||||||
|
- AppAuth/ExternalUserAgent (1.6.2):
|
||||||
|
- AppAuth/Core
|
||||||
- Capacitor (5.0.5):
|
- Capacitor (5.0.5):
|
||||||
- CapacitorCordova
|
- CapacitorCordova
|
||||||
- CapacitorApp (5.0.3):
|
- CapacitorApp (5.0.3):
|
||||||
@@ -20,6 +26,9 @@ PODS:
|
|||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorStatusBar (5.0.4):
|
- CapacitorStatusBar (5.0.4):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
|
- CodetrixStudioCapacitorGoogleAuth (0.0.1):
|
||||||
|
- Capacitor
|
||||||
|
- GoogleSignIn (~> 6.2.4)
|
||||||
- CordovaPluginsStatic (5.0.5):
|
- CordovaPluginsStatic (5.0.5):
|
||||||
- CapacitorCordova
|
- CapacitorCordova
|
||||||
- OneSignalXCFramework (= 5.0.0-beta-04)
|
- OneSignalXCFramework (= 5.0.0-beta-04)
|
||||||
@@ -31,6 +40,14 @@ PODS:
|
|||||||
- FBSDKCoreKit_Basics (16.1.3)
|
- FBSDKCoreKit_Basics (16.1.3)
|
||||||
- FBSDKLoginKit (16.1.3):
|
- FBSDKLoginKit (16.1.3):
|
||||||
- FBSDKCoreKit (= 16.1.3)
|
- FBSDKCoreKit (= 16.1.3)
|
||||||
|
- GoogleSignIn (6.2.4):
|
||||||
|
- AppAuth (~> 1.5)
|
||||||
|
- GTMAppAuth (~> 1.3)
|
||||||
|
- GTMSessionFetcher/Core (< 3.0, >= 1.1)
|
||||||
|
- GTMAppAuth (1.3.1):
|
||||||
|
- AppAuth/Core (~> 1.6)
|
||||||
|
- GTMSessionFetcher/Core (< 3.0, >= 1.5)
|
||||||
|
- GTMSessionFetcher/Core (2.3.0)
|
||||||
- OneSignalXCFramework (5.0.0-beta-04):
|
- OneSignalXCFramework (5.0.0-beta-04):
|
||||||
- OneSignalXCFramework/OneSignalCore (= 5.0.0-beta-04)
|
- OneSignalXCFramework/OneSignalCore (= 5.0.0-beta-04)
|
||||||
- OneSignalXCFramework/OneSignalExtension (= 5.0.0-beta-04)
|
- OneSignalXCFramework/OneSignalExtension (= 5.0.0-beta-04)
|
||||||
@@ -67,6 +84,7 @@ DEPENDENCIES:
|
|||||||
- "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
|
- "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
|
||||||
- "CapacitorPreferences (from `../../node_modules/@capacitor/preferences`)"
|
- "CapacitorPreferences (from `../../node_modules/@capacitor/preferences`)"
|
||||||
- "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
|
- "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
|
||||||
|
- "CodetrixStudioCapacitorGoogleAuth (from `../../node_modules/@codetrix-studio/capacitor-google-auth`)"
|
||||||
- CordovaPluginsStatic (from `../capacitor-cordova-ios-plugins`)
|
- CordovaPluginsStatic (from `../capacitor-cordova-ios-plugins`)
|
||||||
- FBSDKCoreKit (= 16.1.3)
|
- FBSDKCoreKit (= 16.1.3)
|
||||||
- FBSDKLoginKit (= 16.1.3)
|
- FBSDKLoginKit (= 16.1.3)
|
||||||
@@ -74,10 +92,14 @@ DEPENDENCIES:
|
|||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
|
- AppAuth
|
||||||
- FBAEMKit
|
- FBAEMKit
|
||||||
- FBSDKCoreKit
|
- FBSDKCoreKit
|
||||||
- FBSDKCoreKit_Basics
|
- FBSDKCoreKit_Basics
|
||||||
- FBSDKLoginKit
|
- FBSDKLoginKit
|
||||||
|
- GoogleSignIn
|
||||||
|
- GTMAppAuth
|
||||||
|
- GTMSessionFetcher
|
||||||
- OneSignalXCFramework
|
- OneSignalXCFramework
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
@@ -101,10 +123,13 @@ EXTERNAL SOURCES:
|
|||||||
:path: "../../node_modules/@capacitor/preferences"
|
:path: "../../node_modules/@capacitor/preferences"
|
||||||
CapacitorStatusBar:
|
CapacitorStatusBar:
|
||||||
:path: "../../node_modules/@capacitor/status-bar"
|
:path: "../../node_modules/@capacitor/status-bar"
|
||||||
|
CodetrixStudioCapacitorGoogleAuth:
|
||||||
|
:path: "../../node_modules/@codetrix-studio/capacitor-google-auth"
|
||||||
CordovaPluginsStatic:
|
CordovaPluginsStatic:
|
||||||
:path: "../capacitor-cordova-ios-plugins"
|
:path: "../capacitor-cordova-ios-plugins"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
|
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
|
||||||
Capacitor: b1248915663add1bd6567e2b67c1c1fa3abcf5e8
|
Capacitor: b1248915663add1bd6567e2b67c1c1fa3abcf5e8
|
||||||
CapacitorApp: 7a5dec8b33573707164b293475d5c89ba684364a
|
CapacitorApp: 7a5dec8b33573707164b293475d5c89ba684364a
|
||||||
CapacitorCommunityAppleSignIn: eafdd59b18b38161fa5cceee7b0e31312b122958
|
CapacitorCommunityAppleSignIn: eafdd59b18b38161fa5cceee7b0e31312b122958
|
||||||
@@ -115,13 +140,17 @@ SPEC CHECKSUMS:
|
|||||||
CapacitorKeyboard: d1b25fde6f19744ad09c890862aefc6e2a7ded3d
|
CapacitorKeyboard: d1b25fde6f19744ad09c890862aefc6e2a7ded3d
|
||||||
CapacitorPreferences: f03954bcb0ff09c792909e46bff88e3183c16b10
|
CapacitorPreferences: f03954bcb0ff09c792909e46bff88e3183c16b10
|
||||||
CapacitorStatusBar: 190e0321b8734f4244d0c81baa183a00d5806ddf
|
CapacitorStatusBar: 190e0321b8734f4244d0c81baa183a00d5806ddf
|
||||||
|
CodetrixStudioCapacitorGoogleAuth: fcce058390347c1ce5d8ac4764bdf1f5c1ee233b
|
||||||
CordovaPluginsStatic: c1b87170d7e6c70c473250768081e07414af3879
|
CordovaPluginsStatic: c1b87170d7e6c70c473250768081e07414af3879
|
||||||
FBAEMKit: af2972f39bb0f3f7c45998f435b007833c32ffb2
|
FBAEMKit: af2972f39bb0f3f7c45998f435b007833c32ffb2
|
||||||
FBSDKCoreKit: 19e2e18b3be578d7a51fed8fdd8c152bef0b9511
|
FBSDKCoreKit: 19e2e18b3be578d7a51fed8fdd8c152bef0b9511
|
||||||
FBSDKCoreKit_Basics: dd9826ce3c9fd9f8cdf8dbbd0ef0a53e6c0c9e7e
|
FBSDKCoreKit_Basics: dd9826ce3c9fd9f8cdf8dbbd0ef0a53e6c0c9e7e
|
||||||
FBSDKLoginKit: c395c63a1a6cf4a8a1e6103fd94b8c46329ee81c
|
FBSDKLoginKit: c395c63a1a6cf4a8a1e6103fd94b8c46329ee81c
|
||||||
|
GoogleSignIn: 5651ce3a61e56ca864160e79b484cd9ed3f49b7a
|
||||||
|
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
|
||||||
|
GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
|
||||||
OneSignalXCFramework: 0225dc78b9c611be84733e5adc9b68638632c1e8
|
OneSignalXCFramework: 0225dc78b9c611be84733e5adc9b68638632c1e8
|
||||||
|
|
||||||
PODFILE CHECKSUM: 7d6a1b0dbd7cb987c2121b75ec46088af01da740
|
PODFILE CHECKSUM: 6f3fca74c9da63a49dc76a4a79d1ca8197e91f23
|
||||||
|
|
||||||
COCOAPODS: 1.12.1
|
COCOAPODS: 1.13.0
|
||||||
|
|||||||
Generated
+17
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "WrenchBoard",
|
"name": "WrenchBoard",
|
||||||
"version": "42.4.2",
|
"version": "42.8.7",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "WrenchBoard",
|
"name": "WrenchBoard",
|
||||||
"version": "42.4.2",
|
"version": "42.8.7",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "^14.0.0",
|
"@angular/common": "^14.0.0",
|
||||||
"@angular/core": "^14.0.0",
|
"@angular/core": "^14.0.0",
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
"@capacitor/keyboard": "^5.0.0",
|
"@capacitor/keyboard": "^5.0.0",
|
||||||
"@capacitor/preferences": "^5.0.6",
|
"@capacitor/preferences": "^5.0.6",
|
||||||
"@capacitor/status-bar": "^5.0.0",
|
"@capacitor/status-bar": "^5.0.0",
|
||||||
|
"@codetrix-studio/capacitor-google-auth": "^3.3.2",
|
||||||
"@ionic/angular": "^6.1.9",
|
"@ionic/angular": "^6.1.9",
|
||||||
"angularx-qrcode": "^14.0.0",
|
"angularx-qrcode": "^14.0.0",
|
||||||
"bn-ng-idle": "^2.0.5",
|
"bn-ng-idle": "^2.0.5",
|
||||||
@@ -2629,6 +2630,14 @@
|
|||||||
"@capacitor/core": "^5.0.0"
|
"@capacitor/core": "^5.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@codetrix-studio/capacitor-google-auth": {
|
||||||
|
"version": "3.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@codetrix-studio/capacitor-google-auth/-/capacitor-google-auth-3.3.2.tgz",
|
||||||
|
"integrity": "sha512-RHYsgm/pU4JNmed5lYlT+xtoU6ktfw4/xG3o1iI5n7dhWO77kptOr2ZaVSXsYeOu1J93VeyOAyyqdaF+qkzxhw==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@capacitor/core": "^5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@colors/colors": {
|
"node_modules/@colors/colors": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
|
||||||
@@ -21661,6 +21670,12 @@
|
|||||||
"integrity": "sha512-6gvkUTotpzHlfn5KoIglbIqdaEWV/crLtCYXebtFtRAPofCU8EWcljGeeISKBYPE99xqsk3M66vRUY4OzsAYyA==",
|
"integrity": "sha512-6gvkUTotpzHlfn5KoIglbIqdaEWV/crLtCYXebtFtRAPofCU8EWcljGeeISKBYPE99xqsk3M66vRUY4OzsAYyA==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
|
"@codetrix-studio/capacitor-google-auth": {
|
||||||
|
"version": "3.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@codetrix-studio/capacitor-google-auth/-/capacitor-google-auth-3.3.2.tgz",
|
||||||
|
"integrity": "sha512-RHYsgm/pU4JNmed5lYlT+xtoU6ktfw4/xG3o1iI5n7dhWO77kptOr2ZaVSXsYeOu1J93VeyOAyyqdaF+qkzxhw==",
|
||||||
|
"requires": {}
|
||||||
|
},
|
||||||
"@colors/colors": {
|
"@colors/colors": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
"@capacitor/keyboard": "^5.0.0",
|
"@capacitor/keyboard": "^5.0.0",
|
||||||
"@capacitor/preferences": "^5.0.6",
|
"@capacitor/preferences": "^5.0.6",
|
||||||
"@capacitor/status-bar": "^5.0.0",
|
"@capacitor/status-bar": "^5.0.0",
|
||||||
|
"@codetrix-studio/capacitor-google-auth": "^3.3.2",
|
||||||
"@ionic/angular": "^6.1.9",
|
"@ionic/angular": "^6.1.9",
|
||||||
"angularx-qrcode": "^14.0.0",
|
"angularx-qrcode": "^14.0.0",
|
||||||
"bn-ng-idle": "^2.0.5",
|
"bn-ng-idle": "^2.0.5",
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import { Component } from '@angular/core';
|
|||||||
import { BnNgIdleService } from 'bn-ng-idle';
|
import { BnNgIdleService } from 'bn-ng-idle';
|
||||||
import {SessionDataProviderService} from "./store/session-data-provider.service";
|
import {SessionDataProviderService} from "./store/session-data-provider.service";
|
||||||
import {Router} from "@angular/router"; // import it to your component
|
import {Router} from "@angular/router"; // import it to your component
|
||||||
|
import { Platform } from '@ionic/angular';
|
||||||
|
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
@@ -9,7 +11,11 @@ import {Router} from "@angular/router"; // import it to your component
|
|||||||
styleUrls: ['app.component.scss'],
|
styleUrls: ['app.component.scss'],
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
constructor(private bnIdle: BnNgIdleService,private sessionDataProviderService : SessionDataProviderService, public router: Router) {
|
constructor(
|
||||||
|
private bnIdle: BnNgIdleService,
|
||||||
|
private sessionDataProviderService : SessionDataProviderService,
|
||||||
|
public router: Router,
|
||||||
|
public platform: Platform) {
|
||||||
// this.OneSignalInit();
|
// this.OneSignalInit();
|
||||||
this.bnIdle.startWatching(2500).subscribe((res) => {
|
this.bnIdle.startWatching(2500).subscribe((res) => {
|
||||||
if(res) {
|
if(res) {
|
||||||
@@ -18,11 +24,18 @@ export class AppComponent {
|
|||||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||||
this.router.navigate(['login']);
|
this.router.navigate(['login']);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
this.initializeApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call this function when your app starts
|
// Call this function when your app starts
|
||||||
OneSignalInit(): void {
|
OneSignalInit(): void {
|
||||||
console.log('Moved to home');
|
console.log('Moved to home');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initializeApp(): void {
|
||||||
|
this.platform.ready().then(() => {
|
||||||
|
//GoogleAuth.initialize()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,12 +72,12 @@
|
|||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
|
|
||||||
<ion-buttons>
|
<ion-buttons>
|
||||||
<ion-button>
|
<ion-button (click) ="onLoginGoogle()" >
|
||||||
<ion-icon name="logo-google"></ion-icon>
|
<ion-icon name="logo-google"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
|
|
||||||
<ion-buttons>
|
<ion-buttons *ngIf="ios">
|
||||||
<ion-button (click) ="onLoginApple()" >
|
<ion-button (click) ="onLoginApple()" >
|
||||||
<ion-icon name="logo-apple"></ion-icon>
|
<ion-icon name="logo-apple"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { WrenchService } from 'src/app/services/wrench.service';
|
|||||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||||
import { BlogDataService } from 'src/app/store/blog-data.service';
|
import { BlogDataService } from 'src/app/store/blog-data.service';
|
||||||
import { environment} from "../../../environments/environment";
|
import { environment} from "../../../environments/environment";
|
||||||
import { AlertController } from '@ionic/angular';
|
import { AlertController, Platform } from '@ionic/angular';
|
||||||
import { Preferences } from '@capacitor/preferences';
|
import { Preferences } from '@capacitor/preferences';
|
||||||
import { Capacitor } from '@capacitor/core';
|
import { Capacitor } from '@capacitor/core';
|
||||||
import jwt_decode from "jwt-decode";
|
import jwt_decode from "jwt-decode";
|
||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
FacebookLogin,
|
FacebookLogin,
|
||||||
FacebookLoginResponse,
|
FacebookLoginResponse,
|
||||||
} from '@capacitor-community/facebook-login';
|
} from '@capacitor-community/facebook-login';
|
||||||
|
import { GoogleAuth, User } from '@codetrix-studio/capacitor-google-auth';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
@@ -32,15 +33,30 @@ export class LoginPage implements OnInit {
|
|||||||
appleSignInAbortController: any;
|
appleSignInAbortController: any;
|
||||||
appleSignInWindow: any;
|
appleSignInWindow: any;
|
||||||
state: any;
|
state: any;
|
||||||
|
ios: boolean;
|
||||||
|
android: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private wrenchService: WrenchService,
|
private wrenchService: WrenchService,
|
||||||
public sessionDataProviderService:SessionDataProviderService,
|
public sessionDataProviderService:SessionDataProviderService,
|
||||||
public blogDataService:BlogDataService,
|
public blogDataService:BlogDataService,
|
||||||
private alertController: AlertController
|
private alertController: AlertController,
|
||||||
|
public platform: Platform
|
||||||
) {
|
) {
|
||||||
|
// https://ionicframework.com/docs/angular/platform
|
||||||
|
this.ios = platform.is('ios');
|
||||||
|
this.android = platform.is('android');
|
||||||
|
}
|
||||||
|
|
||||||
|
ionViewDidEnter() {
|
||||||
|
// GoogleAuth.init();
|
||||||
|
// use hook after platform dom ready
|
||||||
|
GoogleAuth.initialize({
|
||||||
|
clientId: '817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com',
|
||||||
|
scopes: ['profile', 'email'],
|
||||||
|
grantOfflineAccess: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -115,6 +131,54 @@ getBlogData(){
|
|||||||
this.router.navigate(['startscan']);
|
this.router.navigate(['startscan']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onLoginGoogle() {
|
||||||
|
GoogleAuth.signIn().then((user: User) => {
|
||||||
|
//const credential = auth.GoogleAuthProvider.credential(user.authentication.idToken);
|
||||||
|
//return this.afAuth.auth.signInAndRetrieveDataWithCredential(credential);
|
||||||
|
|
||||||
|
if (user) {
|
||||||
|
const oauth2Data = {
|
||||||
|
"auth_type": "GOOGLE",
|
||||||
|
"access_token": user.authentication.accessToken,
|
||||||
|
"refresh_token": user.authentication.refreshToken,
|
||||||
|
"idToken": user.authentication.idToken,
|
||||||
|
"auth_code": user.serverAuthCode,
|
||||||
|
"user": user
|
||||||
|
};
|
||||||
|
console.log(oauth2Data);
|
||||||
|
// Validate token with server and create new session
|
||||||
|
this.wrenchService.authStart(oauth2Data).subscribe(
|
||||||
|
loginResult => {
|
||||||
|
console.log(loginResult);
|
||||||
|
this.loginResult = loginResult;
|
||||||
|
console.log("INTERNAL RETURN->" + this.loginResult.internal_return);
|
||||||
|
|
||||||
|
if (loginResult != null && loginResult.internal_return == 100 && this.sessionDataProviderService.ConstructGlobalSessionData(this.loginResult) == true) {
|
||||||
|
const setName = async () => {
|
||||||
|
await Preferences.set({
|
||||||
|
key: 'username',
|
||||||
|
value: this.username,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getBlogData();
|
||||||
|
this.router.navigate(['tabs/tab1']);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.showAlert("Error","Invalid username/password");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log(user);
|
||||||
|
this.showAlert("Error", "Login failed!");
|
||||||
|
}
|
||||||
|
}).catch((error: any) => {
|
||||||
|
this.showAlert("Error", error);
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onLoginFacebook() {
|
onLoginFacebook() {
|
||||||
const FACEBOOK_PERMISSIONS = [
|
const FACEBOOK_PERMISSIONS = [
|
||||||
'email',
|
'email',
|
||||||
|
|||||||
Reference in New Issue
Block a user