taskinator_ui 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/app/controllers/taskinator_ui/application_controller.rb +7 -0
- data/lib/taskinator_ui/version.rb +1 -1
- data/lib/taskinator_ui.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 399be4dfe6be3c754c86c5422a8cf22030d57999f3e88f7091373ea1181eabad
|
4
|
+
data.tar.gz: 50d621fc5a417a3311024e40bcfcaf9e9826299bf051f1a6f188a2f30ed10415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3adbaf6c711056198c45609b9aa65320c6ebc1084773c3c340f78adbee269605ff6172c245b66483e5edee0b9374896dfb2deea012df739b4dfb618ba0e15e3
|
7
|
+
data.tar.gz: 1d2e67d5d650afe00cfdea0d0af282ccb0ac731ba67f99b509deae7439931647d4305f0ecab06a8f2db337e0fa4ab1b001aa0e42981a5fb4e81985c2a0c0e301
|
data/README.md
CHANGED
@@ -26,6 +26,22 @@ mount TaskinatorUi::Engine, at: '/taskinator'
|
|
26
26
|
|
27
27
|
Run `rails server` and navigate to `http://localhost:3000/taskinator/`
|
28
28
|
|
29
|
+
## HTTP Basic Auth
|
30
|
+
|
31
|
+
To add basic auth add the line into initializer:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
# config/initializers/taskinator.rb
|
35
|
+
|
36
|
+
TaskinatorUi.http_basic_auth = ->(user, password) { user == 'username' && password == 'password' }
|
37
|
+
```
|
38
|
+
|
39
|
+
You can use your database if needed:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
TaskinatorUi.http_basic_auth = ->(email, password) { User.admin.find_by(email: email)&.authenticate(password) }
|
43
|
+
```
|
44
|
+
|
29
45
|
## Known issues
|
30
46
|
|
31
47
|
If you use Rails in API only mode it can happen that you have `Rack::MethodOverride` middleware disabled.
|
@@ -1,4 +1,11 @@
|
|
1
1
|
module TaskinatorUi
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
+
before_action :authenticate, if: -> { TaskinatorUi.http_basic_auth }
|
4
|
+
|
5
|
+
protected
|
6
|
+
|
7
|
+
def authenticate
|
8
|
+
authenticate_or_request_with_http_basic(nil, nil, &TaskinatorUi.http_basic_auth)
|
9
|
+
end
|
3
10
|
end
|
4
11
|
end
|
data/lib/taskinator_ui.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taskinator_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdan Guban
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|